Dela via


HttpRequestMessage.Content Property

Definition

Gets or sets the HTTP content to send to the server on the HttpRequestMessage object.

public:
 property IHttpContent ^ Content { IHttpContent ^ get(); void set(IHttpContent ^ value); };
IHttpContent Content();

void Content(IHttpContent value);
public IHttpContent Content { get; set; }
var iHttpContent = httpRequestMessage.content;
httpRequestMessage.content = iHttpContent;
Public Property Content As IHttpContent

Property Value

The HTTP content to send to the server on the HttpRequestMessage object.

Remarks

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

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

A number of HttpClient methods don't need to set the Content property on the HttpRequestMessage. These include the following:

Applies to