Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

IContentNegotiator.Negotiate Method (Type, HttpRequestMessage, IEnumerable(Of MediaTypeFormatter))

 

Performs content negotiating by selecting the most appropriate MediaTypeFormatter out of the passed in formatters for the given request that can serialize an object of the given type.

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

Function Negotiate (
	type As Type,
	request As HttpRequestMessage,
	formatters As IEnumerable(Of MediaTypeFormatter)
) As ContentNegotiationResult

Parameters

type
Type: System.Type

The type to be serialized.

request
Type: System.Net.Http.HttpRequestMessage

Request message, which contains the header values used to perform negotiation.

formatters
Type: System.Collections.Generic.IEnumerable(Of MediaTypeFormatter)

The set of MediaTypeFormatter objects from which to choose.

Return Value

Type: System.Net.Http.Formatting.ContentNegotiationResult

The result of the negotiation containing the most appropriate MediaTypeFormatter instance, or null if there is no appropriate formatter.

Implementations of this method should call <see cref="M:System.Net.Http.Formatting.MediaTypeFormatter.GetPerRequestFormatterInstance(System.Type,System.Net.Http.HttpRequestMessage,System.Net.Http.Headers.MediaTypeHeaderValue)" /> on the selected MediaTypeFormatter and return the result of that method.

Return to top
Show:
© 2015 Microsoft