FormatterContext Class
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
The context used to identify the HttpRequestMessage or HttpResponseMessage that needs to be either read or written.
Inheritance Hierarchy
System.Object
System.Net.Http.Formatting.FormatterContext
Namespace: System.Net.Http.Formatting
Assembly: System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)
Syntax
'Declaration
Public NotInheritable Class FormatterContext
public sealed class FormatterContext
public ref class FormatterContext sealed
[<Sealed>]
type FormatterContext = class end
public final class FormatterContext
The FormatterContext type exposes the following members.
Constructors
Name | Description | |
---|---|---|
FormatterContext(HttpRequestMessage, Boolean) | Instantiates a new instance of the FormatterContext class to use to serialize or deserialize a request. | |
FormatterContext(HttpResponseMessage, Boolean) | Instantiates a new instance of the FormatterContext class to use to serialize or deserialize a response. | |
FormatterContext(MediaTypeHeaderValue, Boolean) | Instantiates a new instance of a FormatterContext. |
Top
Properties
Name | Description | |
---|---|---|
ContentType | Gets the HTTP Content-Type of the request or response associated with the context. | |
IsRead | Gets a value indicating whether the context will be used to select for formatter for reading or writing the content | |
Request | Gets the HttpRequestMessage associated with the context. | |
Response | Gets the HttpResponseMessage associated with the context or null if there is no associated response message. |
Top
Methods
Name | Description | |
---|---|---|
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Top
Remarks
Either Request or Response will be set, but not both. Whichever is set is the message to be read or written, according to the value of IsRead. In situations where neither a request or response is available, ContentType contains the raw content type.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.