Table of Contents

AddOrUpdateHeader Method

Definition

AddOrUpdateHeader(IDecorator<IHeaderDictionary>, string, StringValues, bool)

Attempts to add or update an existing element with the provided key and value to the enclosed IHeaderDictionary of the decorator.

public static void AddOrUpdateHeader(this IDecorator<IHeaderDictionary> decorator, string key, StringValues value, bool useAsciiEncodingConversion = true)

Parameters

decorator IDecorator<IHeaderDictionary>

The IDecorator<T> 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 bool

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

Exceptions

ArgumentNullException

decorator cannot be null.