HttpResponseMessage Třída

Definice

Představuje zprávu s odpovědí HTTP včetně stavového kódu a dat.Represents a HTTP response message including the status code and data.

public ref class HttpResponseMessage : IDisposable
public class HttpResponseMessage : IDisposable
type HttpResponseMessage = class
    interface IDisposable
Public Class HttpResponseMessage
Implements IDisposable
Dědičnost
HttpResponseMessage
Implementuje

Poznámky

Běžný způsob, jak získat HttpResponseMessage z jedné z HttpClient.SendAsync(HttpRequestMessage) metod, je.A common way to get an HttpResponseMessage is from one of the HttpClient.SendAsync(HttpRequestMessage) methods.

Konstruktory

HttpResponseMessage()

Inicializuje novou instanci HttpResponseMessage třídy.Initializes a new instance of the HttpResponseMessage class.

HttpResponseMessage(HttpStatusCode)

Inicializuje novou instanci HttpResponseMessage třídy s konkrétní StatusCode .Initializes a new instance of the HttpResponseMessage class with a specific StatusCode.

Vlastnosti

Content

Získá nebo nastaví obsah zprávy s odpovědí HTTP.Gets or sets the content of a HTTP response message.

Headers

Získá kolekci hlaviček HTTP odpovědi.Gets the collection of HTTP response headers.

IsSuccessStatusCode

Získá hodnotu, která označuje, zda byla odpověď protokolu HTTP úspěšná.Gets a value that indicates if the HTTP response was successful.

ReasonPhrase

Získá nebo nastaví frázi důvod, která obvykle odesílá servery spolu se stavovým kódem.Gets or sets the reason phrase which typically is sent by servers together with the status code.

RequestMessage

Získá nebo nastaví zprávu požadavku, která vedla k této zprávě odpovědi.Gets or sets the request message which led to this response message.

StatusCode

Získá nebo nastaví stavový kód odpovědi HTTP.Gets or sets the status code of the HTTP response.

TrailingHeaders

Získá kolekci koncových hlaviček obsažených v odpovědi HTTP.Gets the collection of trailing headers included in an HTTP response.

Version

Získá nebo nastaví verzi zprávy HTTP.Gets or sets the HTTP message version.

Metody

Dispose()

Uvolní nespravované prostředky a odstraní nespravované prostředky, které používá HttpResponseMessage .Releases the unmanaged resources and disposes of unmanaged resources used by the HttpResponseMessage.

Dispose(Boolean)

Uvolní nespravované prostředky používané HttpResponseMessage a volitelně vyřadí spravované prostředky.Releases the unmanaged resources used by the HttpResponseMessage and optionally disposes of the managed resources.

EnsureSuccessStatusCode()

Vyvolá výjimku, pokud IsSuccessStatusCode je vlastnost pro odpověď HTTP false .Throws an exception if the IsSuccessStatusCode property for the HTTP response is false.

Equals(Object)

Určí, zda se zadaný objekt rovná aktuálnímu objektu.Determines whether the specified object is equal to the current object.

(Zděděno od Object)
GetHashCode()

Slouží jako výchozí funkce hash.Serves as the default hash function.

(Zděděno od Object)
GetType()

Získá Type aktuální instanci.Gets the Type of the current instance.

(Zděděno od Object)
MemberwiseClone()

Vytvoří kopii aktuálního seznamu Object .Creates a shallow copy of the current Object.

(Zděděno od Object)
ToString()

Vrátí řetězec, který představuje aktuální objekt.Returns a string that represents the current object.

Metody rozšíření

ToMessage(HttpResponseMessage)

Vytvoří Message instanci z HttpResponseMessage instance.Creates a Message instance from an HttpResponseMessage instance.

Platí pro