Show / Hide Table of Contents

Class RESTResponse

Encapsulates the response format for all REST requests.

Inheritance
object
RESTResponse
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Quantellia.WMServer.REST
Assembly: WMServer.dll
Syntax
public class RESTResponse

Fields

Fail

Declaration
public const string Fail = "Fail"
Field Value
Type Description
string

HTTPStatus

Declaration
public const string HTTPStatus = "HTTPStatus"
Field Value
Type Description
string

Success

Declaration
public const string Success = "Success"
Field Value
Type Description
string

Properties

Duration

The time spent processing the request in microseconds.

Declaration
public TimeSpan Duration { get; set; }
Property Value
Type Description
TimeSpan

Message

The error Message if the Status property is not "OK" Null otherwise.

Declaration
public string? Message { get; set; }
Property Value
Type Description
string

RequestTime

The time the request was received.

Declaration
public DateTime RequestTime { get; set; }
Property Value
Type Description
DateTime

Status

Status returned by the response. Must be "OK" or "Error".

Declaration
public string Status { get; set; }
Property Value
Type Description
string

URL

The URL of the request, the response to which will include this object.

Declaration
public string URL { get; set; }
Property Value
Type Description
string

Value

The Value returned by the response. Null if the Status property is not "OK".

Declaration
public object? Value { get; set; }
Property Value
Type Description
object

Methods

Empty()

Performs no modification on the HTTP response and returns an EmptyResult()

Declaration
public static ActionResult Empty()
Returns
Type Description
ActionResult

Error(ControllerBase, Exception, string, string)

Handle all API related errors with standard response generated by input RESTError. Translates generic exceptions into InternalServerError(string, Exception?, string?). Logs the result with calling method info.

Declaration
public static ObjectResult Error(ControllerBase ctrl, Exception ex, string filePath = "<Unknown File>", string callerName = "<Unknown Method>")
Parameters
Type Name Description
ControllerBase ctrl
Exception ex
string filePath

compiler input field.

string callerName

compiler input field.

Returns
Type Description
ObjectResult

OK(ControllerBase, object?, int)

Declaration
public static ObjectResult OK(ControllerBase ctrl, object? val, int code = -1)
Parameters
Type Name Description
ControllerBase ctrl
object val
int code
Returns
Type Description
ObjectResult

RESTSuccess(object)

Declaration
public static RESTResponse RESTSuccess(object val)
Parameters
Type Name Description
object val
Returns
Type Description
RESTResponse
In this article
Back to top Copyright © 2025 Quantellia LLC.    Version 2.0.0 Revision 399     Last Updated 11/16/2025    DRAFT DOCUMENTATION. SUBJECT TO CHANGE