Class EthosResponse
Response object used by the Ethos SDK to contain specific response headers, response body content, and the HTTP response status code. This class contains mostly getter methods on attributes to reduce the possibility of response values being changed.
Inheritance
Namespace: Ellucian.Ethos.Integration.Client
Assembly: Ellucian.Ethos.Integration.dll
Syntax
public class EthosResponse : object
Constructors
EthosResponse(HttpResponseHeaders, String, Int32)
Instantiates an EthosResponse object with the given parameters.
The parameters are intended to be supplied from the EthosResponseBuilder to build this object from an
Declaration
public EthosResponse(HttpResponseHeaders headersMap, string content, int statusCode)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpResponseHeaders | headersMap | A map of headers containing the defined header constants in this class as keys. |
| System.String | content | The response body content. |
| System.Int32 | statusCode | The Http status code of the response. |
Properties
Content
The response body content.
Declaration
public string Content { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Dto
Content of a strongly typed object.
Declaration
public dynamic Dto { get; }
Property Value
| Type | Description |
|---|---|
| System.Object |
HeadersMap
The http response headers.
Declaration
public HttpResponseHeaders HeadersMap { get; }
Property Value
| Type | Description |
|---|---|
| HttpResponseHeaders |
HttpStatusCode
The Http status code of the Http response.
Declaration
public int HttpStatusCode { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
RequestedUrl
The URL that the corresponding request was made for.
Declaration
public string RequestedUrl { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Methods
GetContentAsJson()
The response body content as JToken.
Declaration
public JToken GetContentAsJson()
Returns
| Type | Description |
|---|---|
| JToken | Returns content as JToken. |
GetContentCount()
Gets count of number of rows in the json content. If the content is of type JArray then we get count from JArray. If its JObject then it's going to be only one.
Declaration
public int GetContentCount()
Returns
| Type | Description |
|---|---|
| System.Int32 | Total number of records. |
GetHeader(String)
Returns the header for the given key.
Declaration
public string GetHeader(string headerKey)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | headerKey | The key used to get the header from the headerMap. |
Returns
| Type | Description |
|---|---|
| System.String | The value for the |
GetHeaderMapKeys()
Gets the keys in the header map, which can be used to retrieve specific header values from
Declaration
public IEnumerable<string> GetHeaderMapKeys()
Returns
| Type | Description |
|---|---|
| IEnumerable<System.String> | A list of header map keys. |