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)

Declaration
public static ObjectResult Error(ControllerBase ctrl, Exception ex)
Parameters
Type Name Description
ControllerBase ctrl
Exception ex
Returns
Type Description
ObjectResult

Error(ControllerBase, string, int)

Declaration
public static ObjectResult Error(ControllerBase ctrl, string message, int code)
Parameters
Type Name Description
ControllerBase ctrl
string message
int code
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

RESTError(string)

Declaration
public static RESTResponse RESTError(string message)
Parameters
Type Name Description
string message
Returns
Type Description
RESTResponse

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 1/15/2025    DRAFT DOCUMENTATION. SUBJECT TO CHANGE