// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. #if DOTNET5_4 using System.Collections.Generic; using System.Net.Http.Headers; namespace System.Net.Http.Formatting { /// /// Performs content negotiation. /// This is the process of selecting a response writer (formatter) in compliance with header values in the request. /// public interface IContentNegotiator { /// /// Performs content negotiating by selecting the most appropriate out of the /// passed in for the given that can serialize an /// object of the given . /// /// /// Implementations of this method should call /// on the selected formatter and return the result of that method. /// /// The type to be serialized. /// /// Request message, which contains the header values used to perform negotiation. /// /// The set of objects from which to choose. /// /// The result of the negotiation containing the most appropriate instance, /// or null if there is no appropriate formatter. /// ContentNegotiationResult Negotiate( Type type, HttpRequestMessage request, IEnumerable formatters); } } #endif