ContentType Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets or sets the value of the Content-type HTTP header.

Namespace:  System.Net
Assembly:  System.Http (in System.Http.dll)

public override string ContentType { get; set; }

Property Value

Type: System..::..String
The value of the Content-type HTTP header. The default value is nullNothingnullptrunita null reference (Nothing in Visual Basic).

The ContentType property contains the media type of the request. Values assigned to the ContentType property replace any existing contents when the request sends the Content-type HTTP header.

To clear the Content-type HTTP header, set the ContentType property to nullNothingnullptrunita null reference (Nothing in Visual Basic).

Show: