Bewerken

Share via


HttpRequestMessage.Content Property

Definition

Gets or sets the contents of the HTTP message.

public:
 property System::Net::Http::HttpContent ^ Content { System::Net::Http::HttpContent ^ get(); void set(System::Net::Http::HttpContent ^ value); };
public System.Net.Http.HttpContent Content { get; set; }
public System.Net.Http.HttpContent? Content { get; set; }
member this.Content : System.Net.Http.HttpContent with get, set
Public Property Content As HttpContent

Property Value

The content of a message.

Remarks

The contents of an HTTP message corresponds to the entity body defined in RFC 2616.

A number of classes can be used for HTTP content. These include the following.

  1. ByteArrayContent - HTTP content based on a byte array.

  2. FormUrlEncodedContent - HTTP content of name/value tuples encoded using application/x-www-form-urlencoded MIME type.

  3. MultipartContent - HTTP content that gets serialized using the multipart/* content type specification.

  4. MultipartFormDataContent - HTTP content encoded using the multipart/form-data MIME type.

  5. StreamContent - HTTP content based on a stream.

  6. StringContent - HTTP content based on a string.

Applies to