Search Results for

    Show / Hide Table of Contents

    Class HttpResponseMessage<T>

    Defines a HTTP response message that includes a deserializing option for the response data.

    Inheritance
    System.Object
    HttpResponseMessage<T>
    Namespace: MADE.Networking.Http.Responses
    Assembly: MADE.Networking.dll
    Syntax
    public class HttpResponseMessage<T> : IDisposable
    Type Parameters
    Name Description
    T

    The type of response expected.

    Constructors

    | Improve this Doc View Source

    HttpResponseMessage(HttpResponseMessage)

    Initializes a new instance of the HttpResponseMessage<T> class with the original .

    Declaration
    public HttpResponseMessage(HttpResponseMessage response)
    Parameters
    Type Name Description
    MADE.Networking.Http.Responses.HttpResponseMessage response

    The original .

    Properties

    | Improve this Doc View Source

    Content

    Gets the content of the HTTP response message.

    Declaration
    public HttpContent Content { get; }
    Property Value
    Type Description
    HttpContent
    | Improve this Doc View Source

    DeserializedContent

    Gets the deserialized content of the original as the specified T type.

    Note, ensure that DeserializeAsync() has been called first, otherwise this value will be default.

    Declaration
    public T DeserializedContent { get; }
    Property Value
    Type Description
    T
    | Improve this Doc View Source

    Headers

    Gets the collection of HTTP response headers.

    Declaration
    public HttpResponseHeaders Headers { get; }
    Property Value
    Type Description
    HttpResponseHeaders
    | Improve this Doc View Source

    IsSuccessStatusCode

    Gets a value indicating whether the HTTP response was successful.

    Declaration
    public bool IsSuccessStatusCode { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    ReasonPhrase

    Gets the reason phrase that typically is sent by servers together with the status code.

    Declaration
    public string ReasonPhrase { get; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    RequestMessage

    Gets the request message which led to this response message.

    Declaration
    public HttpRequestMessage RequestMessage { get; }
    Property Value
    Type Description
    HttpRequestMessage
    | Improve this Doc View Source

    StatusCode

    Gets the status code of the HTTP response.

    Declaration
    public HttpStatusCode StatusCode { get; }
    Property Value
    Type Description
    HttpStatusCode
    | Improve this Doc View Source

    Version

    Gets the HTTP message version.

    Declaration
    public Version Version { get; }
    Property Value
    Type Description
    Version

    Methods

    | Improve this Doc View Source

    DeserializeAsync()

    Deserializes the content of the into the DeserializedContent value.

    Declaration
    public async Task<T> DeserializeAsync()
    Returns
    Type Description
    Task<T>

    A representing the result of the asynchronous operation.

    | Improve this Doc View Source

    Dispose()

    Releases the unmanaged resources and disposes of unmanaged resources used by the HttpResponseMessage<T>.

    Declaration
    public void Dispose()
    | Improve this Doc View Source

    Dispose(Boolean)

    Releases the unmanaged resources used by the HttpResponseMessage<T> and optionally disposes of the managed resources.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    A value indicating whether to release both managed and unmanaged resources.

    | Improve this Doc View Source

    EnsureSuccessStatusCode()

    Throws an exception if the IsSuccessStatusCode property for the HTTP response is false.

    Declaration
    public HttpResponseMessage<T> EnsureSuccessStatusCode()
    Returns
    Type Description
    HttpResponseMessage<T>

    The HTTP response message if the call is successful.

    Operators

    | Improve this Doc View Source

    Implicit(HttpResponseMessage to HttpResponseMessage<T>)

    Allows conversion of a to the HttpResponseMessage<T> without direct casting.

    Declaration
    public static implicit operator HttpResponseMessage<T>(HttpResponseMessage response)
    Parameters
    Type Name Description
    MADE.Networking.Http.Responses.HttpResponseMessage response

    The .

    Returns
    Type Description
    HttpResponseMessage<T>

    The HttpResponseMessage<T>.

    Extension Methods

    ReflectionExtensions.GetPropertyValue<T>(Object, String)
    ReflectionExtensions.GetPropertyNames(Object)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright (c) MADE Apps