Table of Contents

AddOrUpdateHeader Method

Definition

AddOrUpdateHeader(IHeaderDictionary, string, StringValues, bool)

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

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

Parameters

dictionary IHeaderDictionary

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

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