Class SimpleResponse
Return type for endpoint handlers with SimpleJsonService.
Inheritance
System.Object
SimpleResponse
Namespace: LaunchDarkly.TestHelpers.HttpTest
Assembly: LaunchDarkly.TestHelpers.dll
Syntax
public sealed class SimpleResponse : ValueType
Properties
Headers
An enumeration of header keys and values.
Declaration
public IEnumerable<KeyValuePair<string, IEnumerable<string>>> Headers { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.Collections.Generic.IEnumerable<System.String>>> |
Status
The HTTP status code.
Declaration
public int Status { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
Of(Int32)
Constructs a SimpleResponse with an HTTP status code.
Declaration
public static SimpleResponse Of(int status)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | status | the status code |
Returns
Type | Description |
---|---|
SimpleResponse |
Of<T>(Int32, T)
Constructs a SimpleResponse with an HTTP status code and a serializable response body.
Declaration
public static SimpleResponse<T> Of<T>(int status, T body)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | status | the status code |
T | body | the value to serialize |
Returns
Type | Description |
---|---|
SimpleResponse<T> |
Type Parameters
Name | Description |
---|---|
T | the value type |
WithHeader(String, String)
Copies this response and adds a header key and value.
Declaration
public SimpleResponse 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 |