System::Net::Http::HttpResponseMessage class

HttpResponseMessage class

Represents an HTTP response message. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

class HttpResponseMessage : public System::IDisposable

Methods

MethodDescription
Dispose() overrideDisposes the current instance. This method also disposes content of the HTTP response.
EnsureSuccessStatusCode()Checks the status code. HttpRequestException will be thrown when the status code doesn’t belong to 2xx.
get_Content() constGets content of the HTTP response.
get_Headers() constReturns the HTTP content headers.
get_IsSuccessStatusCode() constChecks if the status code indicates that the action requested by the client was received, understood, and accepted.
get_ReasonPhrase() constGets the Reason-Phrase that is sent by servers together with the status code.
get_RequestMessage() constGets the HTTP request message.
get_StatusCode() constGets the HTTP status code.
get_Version() constRTTI information.
HttpResponseMessage()Constructs a new instance.
HttpResponseMessage(HttpStatusCode)Constructs a new instance.
set_Content(System::SharedPtr<HttpContent>)Sets content of the HTTP response.
set_ReasonPhrase(String)Sets the Reason-Phrase that is sent by servers together with the status code.
set_RequestMessage(System::SharedPtr<HttpRequestMessage>)Sets the HTTP request message.
set_StatusCode(HttpStatusCode)Sets the HTTP status code.
set_Version(System::Version)Sets the HTTP version.
ToString() const overrideSystem::Object::ToString.

See Also