Class ResponseTypeInfo
Contains information about which .NET type a RESTful HTTP API returns for a given set of status codes and how to deserialize that type from an HttpContent.
Namespace: ReqRest
Assembly: ReqRest.dll
Syntax
public sealed class ResponseTypeInfo
Constructors
ResponseTypeInfo(Type, IEnumerable<StatusCodeRange>, Func<IHttpContentDeserializer>)
Initializes a new instance of the ResponseTypeInfo class
which specifies that an API returns an object of type responseType
for the given statusCodes
.
Declaration
public ResponseTypeInfo(Type responseType, IEnumerable<StatusCodeRange> statusCodes, Func<IHttpContentDeserializer> responseDeserializerFactory)
Parameters
Type | Name | Description |
---|---|---|
Type | responseType | The .NET type representation of the result that the API returns for the status codes defined by StatusCodes. |
IEnumerable<StatusCodeRange> | statusCodes | A set of status codes for which the ResponseType is the result. |
Func<IHttpContentDeserializer> | responseDeserializerFactory | A function which returns an IHttpContentDeserializer that must be used to deserialize the .NET object from an HTTP response. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException |
|
Properties
ResponseDeserializerFactory
Gets a function which returns an IHttpContentDeserializer that must be used to deserialize the .NET object from an HTTP response.
Declaration
public Func<IHttpContentDeserializer> ResponseDeserializerFactory { get; }
ResponseType
Gets the .NET type representation of the result that the API returns for the status codes defined by StatusCodes.
Declaration
public Type ResponseType { get; }
StatusCodes
Gets a set of status codes for which the ResponseType is the result.
Declaration
public ISet<StatusCodeRange> StatusCodes { get; }
Methods
ToString()
Returns a string representation of this response type info.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A string representing this instance. |