EGDL2 2.1
Loading...
Searching...
No Matches
WebSocketSharp.Net.WebHeaderCollection Class Reference

Provides a collection of the HTTP headers associated with a request or response. More...

Inherits NameValueCollection, and ISerializable.

Public Member Functions

 WebHeaderCollection ()
 Initializes a new instance of the WebHeaderCollection class.
 
void Add (string header)
 Adds the specified header to the collection.
 
void Add (HttpRequestHeader header, string value)
 Adds the specified request header with the specified value to the collection.
 
void Add (HttpResponseHeader header, string value)
 Adds the specified response header with the specified value to the collection.
 
override void Add (string name, string value)
 Adds a header with the specified name and value to the collection.
 
override void Clear ()
 Removes all headers from the collection.
 
override string Get (int index)
 Get the value of the header at the specified index in the collection.
 
override string Get (string name)
 Get the value of the header with the specified name in the collection.
 
override IEnumerator GetEnumerator ()
 Gets the enumerator used to iterate through the collection.
 
override string GetKey (int index)
 Get the name of the header at the specified index in the collection.
 
override string[] GetValues (int index)
 Gets an array of header values stored in the specified index position of the collection.
 
override string[] GetValues (string header)
 Gets an array of header values stored in the specified header .
 
override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
 Populates the specified SerializationInfo with the data needed to serialize the WebHeaderCollection.
 
override void OnDeserialization (object sender)
 Implements the ISerializable interface and raises the deserialization event when the deserialization is complete.
 
void Remove (HttpRequestHeader header)
 Removes the specified request header from the collection.
 
void Remove (HttpResponseHeader header)
 Removes the specified response header from the collection.
 
override void Remove (string name)
 Removes the specified header from the collection.
 
void Set (HttpRequestHeader header, string value)
 Sets the specified request header to the specified value.
 
void Set (HttpResponseHeader header, string value)
 Sets the specified response header to the specified value.
 
override void Set (string name, string value)
 Sets the specified header to the specified value.
 
byte[] ToByteArray ()
 Converts the current WebHeaderCollection to an array of byte.
 
override string ToString ()
 Returns a string that represents the current WebHeaderCollection.
 

Static Public Member Functions

static bool IsRestricted (string headerName)
 Determines whether the specified header can be set for the request.
 
static bool IsRestricted (string headerName, bool response)
 Determines whether the specified header can be set for the request or the response.
 

Protected Member Functions

 WebHeaderCollection (SerializationInfo serializationInfo, StreamingContext streamingContext)
 Initializes a new instance of the WebHeaderCollection class from the specified SerializationInfo and StreamingContext.
 
void AddWithoutValidate (string headerName, string headerValue)
 Adds a header to the collection without checking whether the header is on the restricted header list.
 

Properties

override string[] AllKeys [get]
 Gets all header names in the collection.
 
override int Count [get]
 Gets the number of headers in the collection.
 
string this[HttpRequestHeader header] [get, set]
 Gets or sets the specified request header in the collection.
 
string this[HttpResponseHeader header] [get, set]
 Gets or sets the specified response header in the collection.
 
override NameObjectCollectionBase.KeysCollection Keys [get]
 Gets a collection of header names in the collection.
 

Detailed Description

Provides a collection of the HTTP headers associated with a request or response.

Constructor & Destructor Documentation

◆ WebHeaderCollection()

WebSocketSharp.Net.WebHeaderCollection.WebHeaderCollection ( SerializationInfo serializationInfo,
StreamingContext streamingContext )
inlineprotected

Initializes a new instance of the WebHeaderCollection class from the specified SerializationInfo and StreamingContext.

Parameters
serializationInfoA SerializationInfo that contains the serialized object data.
streamingContextA StreamingContext that specifies the source for the deserialization.
Exceptions
ArgumentNullExceptionserializationInfo is null.
ArgumentExceptionAn element with the specified name isn't found in serializationInfo .
Here is the call graph for this function:

Member Function Documentation

◆ Add() [1/4]

void WebSocketSharp.Net.WebHeaderCollection.Add ( HttpRequestHeader header,
string value )
inline

Adds the specified request header with the specified value to the collection.

Parameters
headerOne of the HttpRequestHeader enum values, represents the request header to add.
valueA string that represents the value of the header to add.
Exceptions
ArgumentExceptionheader is a restricted header. -or- value contains invalid characters.
ArgumentOutOfRangeExceptionThe length of value is greater than 65,535 characters.
InvalidOperationExceptionThe current WebHeaderCollection instance doesn't allow the request header .

◆ Add() [2/4]

void WebSocketSharp.Net.WebHeaderCollection.Add ( HttpResponseHeader header,
string value )
inline

Adds the specified response header with the specified value to the collection.

Parameters
headerOne of the HttpResponseHeader enum values, represents the response header to add.
valueA string that represents the value of the header to add.
Exceptions
ArgumentExceptionheader is a restricted header. -or- value contains invalid characters.
ArgumentOutOfRangeExceptionThe length of value is greater than 65,535 characters.
InvalidOperationExceptionThe current WebHeaderCollection instance doesn't allow the response header .

◆ Add() [3/4]

void WebSocketSharp.Net.WebHeaderCollection.Add ( string header)
inline

Adds the specified header to the collection.

Parameters
headerA string that represents the header with the name and value separated by a colon (:).
Exceptions
ArgumentNullExceptionheader is null, empty, or the name part of header is empty.
ArgumentExceptionheader doesn't contain a colon. -or- header is a restricted header. -or- The name or value part of header contains invalid characters.
ArgumentOutOfRangeExceptionThe length of the value part of header is greater than 65,535 characters.
InvalidOperationExceptionThe current WebHeaderCollection instance doesn't allow the header .

◆ Add() [4/4]

override void WebSocketSharp.Net.WebHeaderCollection.Add ( string name,
string value )
inline

Adds a header with the specified name and value to the collection.

Parameters
nameA string that represents the name of the header to add.
valueA string that represents the value of the header to add.
Exceptions
ArgumentNullExceptionname is null or empty.
ArgumentExceptionname or value contains invalid characters. -or- name is a restricted header name.
ArgumentOutOfRangeExceptionThe length of value is greater than 65,535 characters.
InvalidOperationExceptionThe current WebHeaderCollection instance doesn't allow the header name .

◆ AddWithoutValidate()

void WebSocketSharp.Net.WebHeaderCollection.AddWithoutValidate ( string headerName,
string headerValue )
inlineprotected

Adds a header to the collection without checking whether the header is on the restricted header list.

Parameters
headerNameA string that represents the name of the header to add.
headerValueA string that represents the value of the header to add.
Exceptions
ArgumentNullExceptionheaderName is null or empty.
ArgumentExceptionheaderName or headerValue contains invalid characters.
ArgumentOutOfRangeExceptionThe length of headerValue is greater than 65,535 characters.
InvalidOperationExceptionThe current WebHeaderCollection instance doesn't allow the headerName .

◆ Get() [1/2]

override string WebSocketSharp.Net.WebHeaderCollection.Get ( int index)
inline

Get the value of the header at the specified index in the collection.

Returns
A string that receives the value of the header.
Parameters
indexAn int that represents the zero-based index of the header to find.
Exceptions
ArgumentOutOfRangeExceptionindex is out of allowable range of indexes for the collection.
Here is the caller graph for this function:

◆ Get() [2/2]

override string WebSocketSharp.Net.WebHeaderCollection.Get ( string name)
inline

Get the value of the header with the specified name in the collection.

Returns
A string that receives the value of the header if found; otherwise, null.
Parameters
nameA string that represents the name of the header to find.

◆ GetEnumerator()

override IEnumerator WebSocketSharp.Net.WebHeaderCollection.GetEnumerator ( )
inline

Gets the enumerator used to iterate through the collection.

Returns
An IEnumerator instance used to iterate through the collection.

◆ GetKey()

override string WebSocketSharp.Net.WebHeaderCollection.GetKey ( int index)
inline

Get the name of the header at the specified index in the collection.

Returns
A string that receives the header name.
Parameters
indexAn int that represents the zero-based index of the header to find.
Exceptions
ArgumentOutOfRangeExceptionindex is out of allowable range of indexes for the collection.
Here is the caller graph for this function:

◆ GetObjectData()

override void WebSocketSharp.Net.WebHeaderCollection.GetObjectData ( SerializationInfo serializationInfo,
StreamingContext streamingContext )
inline

Populates the specified SerializationInfo with the data needed to serialize the WebHeaderCollection.

Parameters
serializationInfoA SerializationInfo that holds the serialized object data.
streamingContextA StreamingContext that specifies the destination for the serialization.
Exceptions
ArgumentNullExceptionserializationInfo is null.

FIXME: Removed to avoid Unity warning [SecurityPermission ( SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]

Here is the call graph for this function:

◆ GetValues() [1/2]

override string[] WebSocketSharp.Net.WebHeaderCollection.GetValues ( int index)
inline

Gets an array of header values stored in the specified index position of the collection.

Returns
An array of string that receives the header values if found; otherwise, null.
Parameters
indexAn int that represents the zero-based index of the header to find.
Exceptions
ArgumentOutOfRangeExceptionindex is out of allowable range of indexes for the collection.

◆ GetValues() [2/2]

override string[] WebSocketSharp.Net.WebHeaderCollection.GetValues ( string header)
inline

Gets an array of header values stored in the specified header .

Returns
An array of string that receives the header values if found; otherwise, null.
Parameters
headerA string that represents the name of the header to find.

◆ IsRestricted() [1/2]

static bool WebSocketSharp.Net.WebHeaderCollection.IsRestricted ( string headerName)
inlinestatic

Determines whether the specified header can be set for the request.

Returns
true if the header is restricted; otherwise, false.
Parameters
headerNameA string that represents the name of the header to test.
Exceptions
ArgumentNullExceptionheaderName is null or empty.
ArgumentExceptionheaderName contains invalid characters.

◆ IsRestricted() [2/2]

static bool WebSocketSharp.Net.WebHeaderCollection.IsRestricted ( string headerName,
bool response )
inlinestatic

Determines whether the specified header can be set for the request or the response.

Returns
true if the header is restricted; otherwise, false.
Parameters
headerNameA string that represents the name of the header to test.
responsetrue if does the test for the response; for the request, false.
Exceptions
ArgumentNullExceptionheaderName is null or empty.
ArgumentExceptionheaderName contains invalid characters.

◆ OnDeserialization()

override void WebSocketSharp.Net.WebHeaderCollection.OnDeserialization ( object sender)
inline

Implements the ISerializable interface and raises the deserialization event when the deserialization is complete.

Parameters
senderAn object that represents the source of the deserialization event.

◆ Remove() [1/3]

void WebSocketSharp.Net.WebHeaderCollection.Remove ( HttpRequestHeader header)
inline

Removes the specified request header from the collection.

Parameters
headerOne of the HttpRequestHeader enum values, represents the request header to remove.
Exceptions
ArgumentExceptionheader is a restricted header.
InvalidOperationExceptionThe current WebHeaderCollection instance doesn't allow the request header .

◆ Remove() [2/3]

void WebSocketSharp.Net.WebHeaderCollection.Remove ( HttpResponseHeader header)
inline

Removes the specified response header from the collection.

Parameters
headerOne of the HttpResponseHeader enum values, represents the response header to remove.
Exceptions
ArgumentExceptionheader is a restricted header.
InvalidOperationExceptionThe current WebHeaderCollection instance doesn't allow the response header .

◆ Remove() [3/3]

override void WebSocketSharp.Net.WebHeaderCollection.Remove ( string name)
inline

Removes the specified header from the collection.

Parameters
nameA string that represents the name of the header to remove.
Exceptions
ArgumentNullExceptionname is null or empty.
ArgumentExceptionname contains invalid characters. -or- name is a restricted header name.
InvalidOperationExceptionThe current WebHeaderCollection instance doesn't allow the header name .

◆ Set() [1/3]

void WebSocketSharp.Net.WebHeaderCollection.Set ( HttpRequestHeader header,
string value )
inline

Sets the specified request header to the specified value.

Parameters
headerOne of the HttpRequestHeader enum values, represents the request header to set.
valueA string that represents the value of the request header to set.
Exceptions
ArgumentExceptionheader is a restricted header. -or- value contains invalid characters.
ArgumentOutOfRangeExceptionThe length of value is greater than 65,535 characters.
InvalidOperationExceptionThe current WebHeaderCollection instance doesn't allow the request header .

◆ Set() [2/3]

void WebSocketSharp.Net.WebHeaderCollection.Set ( HttpResponseHeader header,
string value )
inline

Sets the specified response header to the specified value.

Parameters
headerOne of the HttpResponseHeader enum values, represents the response header to set.
valueA string that represents the value of the response header to set.
Exceptions
ArgumentExceptionheader is a restricted header. -or- value contains invalid characters.
ArgumentOutOfRangeExceptionThe length of value is greater than 65,535 characters.
InvalidOperationExceptionThe current WebHeaderCollection instance doesn't allow the response header .

◆ Set() [3/3]

override void WebSocketSharp.Net.WebHeaderCollection.Set ( string name,
string value )
inline

Sets the specified header to the specified value.

Parameters
nameA string that represents the name of the header to set.
valueA string that represents the value of the header to set.
Exceptions
ArgumentNullExceptionname is null or empty.
ArgumentExceptionname or value contains invalid characters. -or- name is a restricted header name.
ArgumentOutOfRangeExceptionThe length of value is greater than 65,535 characters.
InvalidOperationExceptionThe current WebHeaderCollection instance doesn't allow the header name .

◆ ToByteArray()

byte[] WebSocketSharp.Net.WebHeaderCollection.ToByteArray ( )
inline

Converts the current WebHeaderCollection to an array of byte.

Returns
An array of byte that receives the converted current WebHeaderCollection.
Here is the call graph for this function:

◆ ToString()

override string WebSocketSharp.Net.WebHeaderCollection.ToString ( )
inline

Returns a string that represents the current WebHeaderCollection.

Returns
A string that represents the current WebHeaderCollection.
Here is the call graph for this function:
Here is the caller graph for this function:

Property Documentation

◆ AllKeys

override string [] WebSocketSharp.Net.WebHeaderCollection.AllKeys
get

Gets all header names in the collection.

An array of string that contains all header names in the collection.

◆ Count

override int WebSocketSharp.Net.WebHeaderCollection.Count
get

Gets the number of headers in the collection.

An int that represents the number of headers in the collection.

◆ Keys

override NameObjectCollectionBase.KeysCollection WebSocketSharp.Net.WebHeaderCollection.Keys
get

Gets a collection of header names in the collection.

A NameObjectCollectionBase.KeysCollection that contains all header names in the collection.

◆ this[HttpRequestHeader header]

string WebSocketSharp.Net.WebHeaderCollection.this[HttpRequestHeader header]
getset

Gets or sets the specified request header in the collection.

A string that represents the value of the request header .

Parameters
headerOne of the HttpRequestHeader enum values, represents the request header to get or set.
Exceptions
ArgumentExceptionheader is a restricted header. -or- value contains invalid characters.
ArgumentOutOfRangeExceptionThe length of value is greater than 65,535 characters.
InvalidOperationExceptionThe current WebHeaderCollection instance doesn't allow the request header .

◆ this[HttpResponseHeader header]

string WebSocketSharp.Net.WebHeaderCollection.this[HttpResponseHeader header]
getset

Gets or sets the specified response header in the collection.

A string that represents the value of the response header .

Parameters
headerOne of the HttpResponseHeader enum values, represents the response header to get or set.
Exceptions
ArgumentExceptionheader is a restricted header. -or- value contains invalid characters.
ArgumentOutOfRangeExceptionThe length of value is greater than 65,535 characters.
InvalidOperationExceptionThe current WebHeaderCollection instance doesn't allow the response header .

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