DefaultContentNegotiator.Negotiate Método

Definición

Realiza la negociación de contenido seleccionando el más apropiado System.Net.Http.Formatting.MediaTypeFormatter del que se pasa formatters para el determinado request que puede serializar un objeto del determinado type .

public:
 virtual System::Net::Http::Formatting::ContentNegotiationResult ^ Negotiate(Type ^ type, System::Net::Http::HttpRequestMessage ^ request, System::Collections::Generic::IEnumerable<System::Net::Http::Formatting::MediaTypeFormatter ^> ^ formatters);
public virtual System.Net.Http.Formatting.ContentNegotiationResult Negotiate (Type type, System.Net.Http.HttpRequestMessage request, System.Collections.Generic.IEnumerable<System.Net.Http.Formatting.MediaTypeFormatter> formatters);
abstract member Negotiate : Type * System.Net.Http.HttpRequestMessage * seq<System.Net.Http.Formatting.MediaTypeFormatter> -> System.Net.Http.Formatting.ContentNegotiationResult
override this.Negotiate : Type * System.Net.Http.HttpRequestMessage * seq<System.Net.Http.Formatting.MediaTypeFormatter> -> System.Net.Http.Formatting.ContentNegotiationResult
Public Overridable Function Negotiate (type As Type, request As HttpRequestMessage, formatters As IEnumerable(Of MediaTypeFormatter)) As ContentNegotiationResult

Parámetros

type
Type

Tipo que se va a serializar.

request
HttpRequestMessage

La solicitud.

formatters
IEnumerable<System.Net.Http.Formatting.MediaTypeFormatter>

Conjunto de System.Net.Http.Formatting.MediaTypeFormatter objetos entre los que se va a elegir.

Devoluciones

ContentNegotiationResult

Resultado de la negociación que contiene la instancia más adecuada System.Net.Http.Formatting.MediaTypeFormatter o null si no hay ningún formateador adecuado.

Implementaciones

Se aplica a