AddOrUpdateHeader Method
Definition
- Namespace
- Cuemon.AspNetCore.Http
- Assemblies
- Cuemon.AspNetCore.dll
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
decoratorIDecorator<IHeaderDictionary>The IDecorator<T> to extend.
keystringThe string to use as the key of the element to add.
valueStringValuesThe string to use as the value of the element to add.
useAsciiEncodingConversionboolif set to
truean ASCII encoding conversion is applied to thevalue.
Exceptions
- ArgumentNullException
decoratorcannot be null.