Table of Contents

Class HeaderDictionaryExtensions

Namespace
Cuemon.Extensions.AspNetCore.Http
Assembly
Cuemon.Extensions.AspNetCore.dll

Extension methods for the Microsoft.AspNetCore.Http.IHeaderDictionary interface.

public static class HeaderDictionaryExtensions
Inheritance
Object
HeaderDictionaryExtensions

Methods

AddOrUpdateHeader(IHeaderDictionary, String, StringValues, Boolean)

Attempts to add or update an existing element with the provided key and value to the Microsoft.AspNetCore.Http.IHeaderDictionary.

public static void AddOrUpdateHeader(this IHeaderDictionary dictionary, string key, StringValues value, bool useAsciiEncodingConversion = true)

Parameters

dictionary IHeaderDictionary

The Microsoft.AspNetCore.Http.IHeaderDictionary to extend.

key String

The string to use as the key of the element to add.

value StringValues

The string to use as the value of the element to add.

useAsciiEncodingConversion Boolean

if set to true an ASCII encoding conversion is applied to the value.

AddOrUpdateHeaders(IHeaderDictionary, HttpResponseHeaders)

Attempts to add or update one or more elements from the provided collection of responseHeaders to the Microsoft.AspNetCore.Http.IHeaderDictionary.

public static void AddOrUpdateHeaders(this IHeaderDictionary dictionary, HttpResponseHeaders responseHeaders)

Parameters

dictionary IHeaderDictionary

The Microsoft.AspNetCore.Http.IHeaderDictionary to extend.

responseHeaders HttpResponseHeaders

The System.Net.Http.Headers.HttpResponseHeaders to copy.