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 or sets the MIME type of the content returned.

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

Syntax

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

Property Value

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

Remarks

When communicating with a Web browser, you should explicitly set this property when returning any content type other than text/html.

.NET Framework Security

See Also

Reference

HttpListenerResponse Class

System.Net Namespace