ReqRest
Show / Hide Table of Contents

Class ApiResponseBase

Defines the shared members of a response which was returned by a RESTful HTTP API after making a request with this library.

Inheritance
Object
HttpResponseMessageBuilder
ApiResponseBase
ApiResponse
ApiResponse<T1>
ApiResponse<T1, T2>
ApiResponse<T1, T2, T3>
ApiResponse<T1, T2, T3, T4>
ApiResponse<T1, T2, T3, T4, T5>
ApiResponse<T1, T2, T3, T4, T5, T6>
ApiResponse<T1, T2, T3, T4, T5, T6, T7>
ApiResponse<T1, T2, T3, T4, T5, T6, T7, T8>
Implements
IHttpResponseMessageBuilder
IHttpHeadersBuilder<HttpResponseHeaders>
IHttpHeadersBuilder
IHttpContentBuilder
IHttpProtocolVersionBuilder
IHttpResponseReasonPhraseBuilder
IHttpStatusCodeBuilder
IBuilder
Namespace: ReqRest
Assembly: ReqRest.dll
Syntax
public abstract class ApiResponseBase : HttpResponseMessageBuilder, IHttpResponseMessageBuilder, IHttpHeadersBuilder<HttpResponseHeaders>, IHttpHeadersBuilder, IHttpContentBuilder, IHttpProtocolVersionBuilder, IHttpResponseReasonPhraseBuilder, IHttpStatusCodeBuilder, IBuilder

Constructors

ApiResponseBase(Nullable<HttpResponseMessage>, Nullable<IEnumerable<ResponseTypeInfo>>)

Initializes a new ApiResponseBase instance with the specified values.

Declaration
public ApiResponseBase(HttpResponseMessage? httpResponseMessage, IEnumerable<ResponseTypeInfo>? possibleResponseTypes)
Parameters
Type Name Description
Nullable<HttpResponseMessage> httpResponseMessage

The HttpResponseMessage which was the underlying result returned by an HttpClient after making the associated request. If null, a new instance is created instead.

Nullable<IEnumerable<ResponseTypeInfo>> possibleResponseTypes

A set of elements that declare which .NET types may have been returned by the HTTP API in this response. If null, an empty set is used instead.

Properties

PossibleResponseTypes

Gets a set of elements that declare which .NET types may have been returned by the HTTP API in this response.

Declaration
protected IReadOnlyCollection<ResponseTypeInfo> PossibleResponseTypes { get; }

Methods

GetCurrentResponseTypeInfo()

Returns the ResponseTypeInfo from the PossibleResponseTypes set which is the most appropriate one for the response's current status code.

This is null if the PossibleResponseTypes property doesn't contain any information which matches the response's status code.

Declaration
protected ResponseTypeInfo GetCurrentResponseTypeInfo()
Returns
Type Description
ResponseTypeInfo

The ResponseTypeInfo from the PossibleResponseTypes set which is the most specific match for the response's current HTTP status code. If there are multiple instances that match this status code with equal specificness, it returns the first one.

Implements

IHttpResponseMessageBuilder
IHttpHeadersBuilder<T>
IHttpHeadersBuilder
IHttpContentBuilder
IHttpProtocolVersionBuilder
IHttpResponseReasonPhraseBuilder
IHttpStatusCodeBuilder
IBuilder

Extension Methods

JsonHttpContentBuilderExtensions.SetJsonContent<T>(T, Nullable<Object>, Nullable<Encoding>, Nullable<JsonHttpContentSerializer>)
BuilderExtensions.Configure<T>(T, Action<T>)
BuilderExtensions.If<T>(T, Boolean, Action<T>)
BuilderExtensions.IfNot<T>(T, Boolean, Action<T>)
HttpContentBuilderExtensions.SetFormUrlEncodedContent<T>(T, (String Key, String Value)[])
HttpContentBuilderExtensions.SetFormUrlEncodedContent<T>(T, IEnumerable<(String Key, String Value)>)
HttpContentBuilderExtensions.SetFormUrlEncodedContent<T>(T, KeyValuePair<String, String>[])
HttpContentBuilderExtensions.SetFormUrlEncodedContent<T>(T, IEnumerable<KeyValuePair<String, String>>)
HttpContentBuilderExtensions.SetContent<T>(T, String, Nullable<Encoding>, Nullable<String>)
HttpContentBuilderExtensions.SetContent<T>(T, Byte[])
HttpContentBuilderExtensions.SetContent<T>(T, Byte[], Int32, Int32)
HttpContentBuilderExtensions.SetContent<T>(T, Nullable<HttpContent>)
HttpContentBuilderExtensions.SetContentType<T>(T, String, Nullable<String>, Nullable<IEnumerable<NameValueHeaderValue>>)
HttpContentBuilderExtensions.SetContentType<T>(T, Nullable<MediaTypeHeaderValue>)
HttpContentBuilderExtensions.AddContentHeader<T>(T, String)
HttpContentBuilderExtensions.AddContentHeader<T>(T, String, Nullable<String>)
HttpContentBuilderExtensions.AddContentHeader<T>(T, String, Nullable<IEnumerable<Nullable<String>>>)
HttpContentBuilderExtensions.RemoveContentHeader<T>(T, Nullable<String>[], names)
HttpContentBuilderExtensions.ClearContentHeaders<T>(T)
HttpContentBuilderExtensions.ConfigureContentHeaders<T>(T, Action<HttpContentHeaders>)
HttpHeadersBuilderExtensions.AddHeader<T>(T, String)
HttpHeadersBuilderExtensions.AddHeader<T>(T, String, Nullable<String>)
HttpHeadersBuilderExtensions.AddHeader<T>(T, String, Nullable<IEnumerable<Nullable<String>>>)
HttpHeadersBuilderExtensions.RemoveHeader<T>(T, Nullable<String>[], names)
HttpHeadersBuilderExtensions.SetHeader<T>(T, String)
HttpHeadersBuilderExtensions.SetHeader<T>(T, String, Nullable<String>)
HttpHeadersBuilderExtensions.SetHeader<T>(T, String, Nullable<IEnumerable<Nullable<String>>>)
HttpHeadersBuilderExtensions.ClearHeaders<T>(T)
HttpHeadersBuilderExtensions.ConfigureHeaders<T>(T, Action<HttpHeaders>)
HttpProtocolVersionBuilderExtensions.SetVersion<T>(T, Version)
HttpResponseMessageBuilderExtensions.ConfigureResponse<T>(T, Action<HttpResponseMessage>)
HttpResponseMessageBuilderExtensions.ConfigureResponse<T>(T, Func<HttpResponseMessage>)
HttpResponseMessageBuilderExtensions.ConfigureResponse<T>(T, Func<HttpResponseMessage, HttpResponseMessage>)
HttpResponseMessageBuilderExtensions.SetResponse<T>(T, HttpResponseMessage)
HttpResponseReasonPhraseBuilderExtensions.SetReasonPhrase<T>(T, Nullable<String>)
HttpStatusCodeBuilderExtensions.SetStatusCode<T>(T, Int32)
HttpStatusCodeBuilderExtensions.SetStatusCode<T>(T, HttpStatusCode)
Back to top Copyright © 2019 ReqRest - Generated with DocFX - Material Theme made by Oscar Vásquez - Impressum (Imprint)