Class HttpRequestMessageExtensions
- Namespace
- GroupeIsa.Neos.Shared.Extensions
- Assembly
- GroupeIsa.Neos.Shared.dll
Provides extension methods for HttpRequestMessage.
public static class HttpRequestMessageExtensions
- Inheritance
-
HttpRequestMessageExtensions
- Inherited Members
Methods
AddHeader(HttpRequestMessage, string, string)
Adds the specified header to the HttpRequestMessage if it does not already exist.
public static void AddHeader(this HttpRequestMessage request, string key, string value)
Parameters
requestHttpRequestMessageThe HTTP request message to which the headers will be added.
keystringThe header key.
valuestringThe header value.
AddHeaders(HttpRequestMessage, IDictionary<string, string>)
Adds the specified headers to the HttpRequestMessage if they do not already exist.
public static void AddHeaders(this HttpRequestMessage request, IDictionary<string, string> headers)
Parameters
requestHttpRequestMessageThe HTTP request message to which the headers will be added.
headersIDictionary<string, string>A dictionary containing the headers to be added.
ReplaceHeader(HttpRequestMessage, string, string)
Adds the specified header to the HttpRequestMessage or replaces it if it already exists.
public static void ReplaceHeader(this HttpRequestMessage request, string key, string value)
Parameters
requestHttpRequestMessageThe HTTP request message to which the headers will be added or replaced.
keystringThe header key.
valuestringThe header value.