Sphyrnidae Common Library  2.0.1
Shared Utilities/Library
Sphyrnidae.Common.Extensions.HttpHeadersExtensions Class Reference

HttpHeaders custom methods More...

Static Public Member Functions

static string Get (this HttpHeaders headers, string name)
 Obtains an item from the HTTP header More...
 
static void Alter (this HttpHeaders headers, string name, string value)
 Ensures the header has the given value More...
 
static void SafeRemove (this HttpHeaders headers, string name)
 Removes a header More...
 

Detailed Description

HttpHeaders custom methods

Member Function Documentation

◆ Alter()

static void Sphyrnidae.Common.Extensions.HttpHeadersExtensions.Alter ( this HttpHeaders  headers,
string  name,
string  value 
)
static

Ensures the header has the given value

Parameters
headersThe headers collection
nameName of the header
valueValue to give the header

This will insert the header if not exist, or update if already exists

◆ Get()

static string Sphyrnidae.Common.Extensions.HttpHeadersExtensions.Get ( this HttpHeaders  headers,
string  name 
)
static

Obtains an item from the HTTP header

Parameters
headersThe current http headers
nameThe name of the HTTP header to retrieve
Returns
The value of the HTTP header

◆ SafeRemove()

static void Sphyrnidae.Common.Extensions.HttpHeadersExtensions.SafeRemove ( this HttpHeaders  headers,
string  name 
)
static

Removes a header

Parameters
headersThe headers collection
nameName of the header

If the header does not exist, this does nothing


The documentation for this class was generated from the following file: