Share via


ContentType Property

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

Gets the MIME type of the body data included in the request.

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

Syntax

'Declaration
Public ReadOnly Property ContentType As String
public string ContentType { get; }
public:
property String^ ContentType {
    String^ get ();
}
member ContentType : string with get
function get ContentType () : String

Property Value

Type: System. . :: . .String
A String that contains the text of the request's Content-Type header.

Remarks

If a client includes body data in a request, it declares the Multipurpose Internet Mail Extensions (MIME) type of the body data in the Content-Type header. For example, the default MIME type of data returned from a Web form using the POST method is application/x-www-form-urlencoded.

For a complete list of request headers, see the HttpRequestHeader enumeration and RFC 2616, available at http://www.rfc-editor.org.

The ContentType is null when there is no Content-Type header in the request.

.NET Framework Security

See Also

Reference

HttpListenerRequest Class

System.Net Namespace