MessageEncoder.ContentType Property

 

When overridden in a derived class, gets the MIME content type used by the encoder.

Namespace:   System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public abstract string ContentType { get; }

Property Value

Type: System.String

The content type that is supported by the message encoder.

The content type is a Multipurpose Internet Mail Exchange (MIME) header that appears at the beginning of a MIME message as well as within the separate body parts. Content-type headers are used to specify the media type and subtype of data in the body of a message and to fully specify the media type and subtype of data in the body of a message and to specify the character encoding (optional) of the data. An example of a MIME content type that can be supported: “application/soap+xml; charset=’utf8’”.

A grammar that details the syntax of the content-type header is described in RFC 2045, Section 5.1. RFC 2046 provides detailed information on MIME media types and their parameters.

public override string ContentType
{
    get
    {
        return this.contentType;
    }
}

Universal Windows Platform
Available since 8
.NET Framework
Available since 3.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show: