C# Class URSA.Web.Http.HeaderCollection

ファイルを表示 Open project: alien-mcl/URSA Class Usage Examples

Public Methods

Method Description
Add ( Header header ) : Header

Adds a new header.

If the header already exists, method will merge new value and parameters with the existing ones.

Add ( string name, string value ) : Header

Adds a new header.

If the header already exists, method will merge new value and parameters with the existing ones.

HeaderCollection ( ) : System

Initializes a new instance of the HeaderCollection class.

Merge ( HeaderCollection headers ) : void

Merges headers.

Parse ( string headers ) : HeaderCollection

Parses a given string as a HeaderCollection.

Remove ( string name ) : bool

Removes the header with given name.

Set ( Header header ) : Header

Sets a new header.

If the header already exists, it is replaced with the new one.

Set ( string name, string value ) : Header

Sets a new header.

If the header already exists, it is replaced with the new one.

TryParse ( string headers, HeaderCollection &headersCollection ) : bool

Tries to parse a given string as a HeaderCollection.

this ( string name ) : Header

Gets or sets the header by it's name.

Private Methods

Method Description
ToString ( ) : string

Method Details

Add() public method

Adds a new header.
If the header already exists, method will merge new value and parameters with the existing ones.
public Add ( Header header ) : Header
header Header Header to be added.
return Header

Add() public method

Adds a new header.
If the header already exists, method will merge new value and parameters with the existing ones.
public Add ( string name, string value ) : Header
name string Name of the header to be added.
value string Value of the header to be added.
return Header

HeaderCollection() public method

Initializes a new instance of the HeaderCollection class.
public HeaderCollection ( ) : System
return System

Merge() public method

Merges headers.
public Merge ( HeaderCollection headers ) : void
headers HeaderCollection Headers to be merged.
return void

Parse() public static method

Parses a given string as a HeaderCollection.
public static Parse ( string headers ) : HeaderCollection
headers string String to be parsed.
return HeaderCollection

Remove() public method

Removes the header with given name.
public Remove ( string name ) : bool
name string Name of the header to be removed.
return bool

Set() public method

Sets a new header.
If the header already exists, it is replaced with the new one.
public Set ( Header header ) : Header
header Header Header to be set.
return Header

Set() public method

Sets a new header.
If the header already exists, it is replaced with the new one.
public Set ( string name, string value ) : Header
name string Name of the header to be added.
value string Value of the header to be added.
return Header

TryParse() public static method

Tries to parse a given string as a HeaderCollection.
public static TryParse ( string headers, HeaderCollection &headersCollection ) : bool
headers string String to be parsed.
headersCollection HeaderCollection Resulting collection of headers if parsing was successful; otherwise null.
return bool

this() public method

Gets or sets the header by it's name.
public this ( string name ) : Header
name string Name of the header.
return Header