Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MediaType Property

HttpWebRequest.MediaType Property

Gets or sets the media type of the request.

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

public string MediaType { get; set; }

Property Value

Type: System.String
The media type of the request. The default value is null.

The value of the MediaType property affects the CharacterSet property. When you set the MediaType in the request, the corresponding media type is chosen from the list of character sets returned in the response Content-type HTTP header.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft