Class SimpleResponse<T>
Return type for endpoint handlers with SimpleJsonService, when they return a value to be serialized as a response body.
Inheritance
System.Object
SimpleResponse<T>
Namespace: LaunchDarkly.TestHelpers.HttpTest
Assembly: LaunchDarkly.TestHelpers.dll
Syntax
public sealed class SimpleResponse<T> : ValueType
Type Parameters
Name | Description |
---|---|
T |
Properties
Base
The basic response properties.
Declaration
public SimpleResponse Base { get; }
Property Value
Type | Description |
---|---|
SimpleResponse |
Body
The value to serialize as the response.
Declaration
public T Body { get; }
Property Value
Type | Description |
---|---|
T |
Methods
Of(Int32, T)
Constructs a SimpleResponse<T> with an HTTP status code and a serializable response body.
Declaration
public static SimpleResponse<T> Of(int status, T value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | status | the status code |
T | value | the value to serialize |
Returns
Type | Description |
---|---|
SimpleResponse<T> |
WithHeader(String, String)
Copies this response and adds a header key and value.
Declaration
public SimpleResponse<T> WithHeader(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | a header key |
System.String | value | a header value |
Returns
Type | Description |
---|---|
SimpleResponse<T> |