Table of Contents

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

request HttpRequestMessage

The HTTP request message to which the headers will be added.

key string

The header key.

value string

The 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

request HttpRequestMessage

The HTTP request message to which the headers will be added.

headers IDictionary<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

request HttpRequestMessage

The HTTP request message to which the headers will be added or replaced.

key string

The header key.

value string

The header value.