GlidingSquirrel : SBRL.GlidingSquirrel.Http Namespace

HttpRequest Class

Represents an http request.

Syntax

public class HttpRequest : HttpMessage

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: SBRL.GlidingSquirrel.Http
Assembly: GlidingSquirrel (in GlidingSquirrel.dll)
Assembly Versions: 0.0.0.0, 1.0.6562.35419, 1.0.6562.35930, 1.0.6566.37627, 1.0.6620.40465, 1.0.6629.34522, 1.0.6744.34319, 1.0.6744.34540, 1.0.6746.26208, 1.0.6746.26412, 1.0.6746.26518, 1.0.6746.26789, 1.0.6746.26804, 1.0.6746.26825, 1.0.6746.26834, 1.0.6746.26851, 1.0.6746.26854, 1.0.6746.27195, 1.0.6746.27200, 1.0.6786.21077, 1.0.6786.21083, 1.0.6786.38758, 1.0.6786.38797, 1.0.6786.38837, 1.0.6786.38901, 1.0.6786.38913, 1.0.6786.39083, 1.0.6786.39119, 1.0.6786.39136, 1.0.6786.39265

Members

See Also: Inherited members from HttpMessage.

Public Constructors

Creates a new http request.

Public Fields

Body System.IO.StreamReader . The request body. (Inherited from HttpMessage.)
ClientAddress System.Net.IPEndPoint . The address that the client is connecting from.
ClientConnection System.Net.Sockets.TcpClient . The underlying conenction to the remote client.
Headers Dictionary<string, string> . A dictionary of key => value headers present in the message. (Inherited from HttpMessage.)
HttpVersion float . The version of the HTTP protocol in use. (Inherited from HttpMessage.)
Method HttpMethod . The method used in this http request.
readonly
RequestNumber int . An incrementing value that represents the number of requests that have been made previously on the connection that this request was recieved on. Starts at 0 and is incremented by 1 each time a request is handled.
Url string . The url requested by this request. Not processed according to the host header at all.

Public Properties

[read-only]
Accepts string . Quick access to the accepts http header.
[read-only]
BasicAuthCredentials HttpBasicAuthCredentials . Decodes, parses, and returns the credentials supplied in the request via Http Basic Authentication.
ContentLength int . Quality of life property providing quick access to the length of the body of the message. (Inherited from HttpMessage.)
ContentType string . Quality of life property providing quick access to the content type of the message. (Inherited from HttpMessage.)
[read-only]
Host string . Quick access to the host http header.
TransferEncoding string . Quality of life property providing quick access to the transfer encoding of the body of the message. (Inherited from HttpMessage.)
[read-only]
UserAgent string . Quick access to the user-agent http header.

Public Methods

static
FromStream (System.IO.StreamReader) : System.Threading.Tasks.Task<HttpRequest>
Builds a new HttpRequest instance from the supplied data stream. May throw an exception if unsuccessful.
GetHeaderValue (string, string) : string
Fetches the value of a header present in the message. Returns the specified default value if no value was found. (Inherited from HttpMessage.)
static
MethodFromString (string) : HttpMethod
Converts a http method stored in a string to the HttpMethod enum. Multiple header defintions are concatenated in the order that they appear, delimited by a comma.
static
ParseFirstLine (string) : ValueTuple<float, HttpMethod, string>
Parses the first line of a http request, and return the result as a C# 7 tuple. Don't panic if your editor doesn't appear to like this - it'll compile just fine :P
static
ParseHeaders (List<string>) : Dictionary<string, string>
Parses a raw lsit of headers into a dictionary of headers keys and values.
WillAccept (string) : bool
Works out whether this request will accept a given mime type as a response.

Member Details

HttpRequest Constructor

Creates a new http request.

Syntax

public HttpRequest ()

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: SBRL.GlidingSquirrel.Http
Assembly: GlidingSquirrel (in GlidingSquirrel.dll)
Assembly Versions: 0.0.0.0, 1.0.6562.35419, 1.0.6562.35930, 1.0.6566.37627, 1.0.6620.40465, 1.0.6629.34522, 1.0.6744.34319, 1.0.6744.34540, 1.0.6746.26208, 1.0.6746.26412, 1.0.6746.26518, 1.0.6746.26789, 1.0.6746.26804, 1.0.6746.26825, 1.0.6746.26834, 1.0.6746.26851, 1.0.6746.26854, 1.0.6746.27195, 1.0.6746.27200, 1.0.6786.21077, 1.0.6786.21083, 1.0.6786.38758, 1.0.6786.38797, 1.0.6786.38837, 1.0.6786.38901, 1.0.6786.38913, 1.0.6786.39083, 1.0.6786.39119, 1.0.6786.39136, 1.0.6786.39265

Accepts Property

Quick access to the accepts http header.

Syntax

public string Accepts { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: SBRL.GlidingSquirrel.Http
Assembly: GlidingSquirrel (in GlidingSquirrel.dll)
Assembly Versions: 0.0.0.0, 1.0.6562.35419, 1.0.6562.35930, 1.0.6566.37627, 1.0.6620.40465, 1.0.6629.34522, 1.0.6744.34319, 1.0.6744.34540, 1.0.6746.26208, 1.0.6746.26412, 1.0.6746.26518, 1.0.6746.26789, 1.0.6746.26804, 1.0.6746.26825, 1.0.6746.26834, 1.0.6746.26851, 1.0.6746.26854, 1.0.6746.27195, 1.0.6746.27200, 1.0.6786.21077, 1.0.6786.21083, 1.0.6786.38758, 1.0.6786.38797, 1.0.6786.38837, 1.0.6786.38901, 1.0.6786.38913, 1.0.6786.39083, 1.0.6786.39119, 1.0.6786.39136, 1.0.6786.39265

BasicAuthCredentials Property

Decodes, parses, and returns the credentials supplied in the request via Http Basic Authentication.

Syntax

public HttpBasicAuthCredentials BasicAuthCredentials { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: SBRL.GlidingSquirrel.Http
Assembly: GlidingSquirrel (in GlidingSquirrel.dll)
Assembly Versions: 0.0.0.0, 1.0.6562.35419, 1.0.6562.35930, 1.0.6566.37627, 1.0.6620.40465, 1.0.6629.34522, 1.0.6744.34319, 1.0.6744.34540, 1.0.6746.26208, 1.0.6746.26412, 1.0.6746.26518, 1.0.6746.26789, 1.0.6746.26804, 1.0.6746.26825, 1.0.6746.26834, 1.0.6746.26851, 1.0.6746.26854, 1.0.6746.27195, 1.0.6746.27200, 1.0.6786.21077, 1.0.6786.21083, 1.0.6786.38758, 1.0.6786.38797, 1.0.6786.38837, 1.0.6786.38901, 1.0.6786.38913, 1.0.6786.39083, 1.0.6786.39119, 1.0.6786.39136, 1.0.6786.39265

ClientAddress Field

The address that the client is connecting from.

Syntax

public System.Net.IPEndPoint ClientAddress

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: SBRL.GlidingSquirrel.Http
Assembly: GlidingSquirrel (in GlidingSquirrel.dll)
Assembly Versions: 0.0.0.0, 1.0.6562.35419, 1.0.6562.35930, 1.0.6566.37627, 1.0.6620.40465, 1.0.6629.34522, 1.0.6744.34319, 1.0.6744.34540, 1.0.6746.26208, 1.0.6746.26412, 1.0.6746.26518, 1.0.6746.26789, 1.0.6746.26804, 1.0.6746.26825, 1.0.6746.26834, 1.0.6746.26851, 1.0.6746.26854, 1.0.6746.27195, 1.0.6746.27200, 1.0.6786.21077, 1.0.6786.21083, 1.0.6786.38758, 1.0.6786.38797, 1.0.6786.38837, 1.0.6786.38901, 1.0.6786.38913, 1.0.6786.39083, 1.0.6786.39119, 1.0.6786.39136, 1.0.6786.39265

ClientConnection Field

The underlying conenction to the remote client.

Syntax

public System.Net.Sockets.TcpClient ClientConnection

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: SBRL.GlidingSquirrel.Http
Assembly: GlidingSquirrel (in GlidingSquirrel.dll)
Assembly Versions: 0.0.0.0, 1.0.6562.35419, 1.0.6562.35930, 1.0.6566.37627, 1.0.6620.40465, 1.0.6629.34522, 1.0.6744.34319, 1.0.6744.34540, 1.0.6746.26208, 1.0.6746.26412, 1.0.6746.26518, 1.0.6746.26789, 1.0.6746.26804, 1.0.6746.26825, 1.0.6746.26834, 1.0.6746.26851, 1.0.6746.26854, 1.0.6746.27195, 1.0.6746.27200, 1.0.6786.21077, 1.0.6786.21083, 1.0.6786.38758, 1.0.6786.38797, 1.0.6786.38837, 1.0.6786.38901, 1.0.6786.38913, 1.0.6786.39083, 1.0.6786.39119, 1.0.6786.39136, 1.0.6786.39265

FromStream Method

Builds a new HttpRequest instance from the supplied data stream. May throw an exception if unsuccessful.

Syntax

[System.Diagnostics.DebuggerStepThrough]
[System.Runtime.CompilerServices.AsyncStateMachine(typeof(SBRL.GlidingSquirrel.Http.HttpRequest/<FromStream>d__14))]
public static System.Threading.Tasks.Task<HttpRequest> FromStream (System.IO.StreamReader source)

Parameters

source
The source stream to build the HttpRequest instance from.

Returns

The completed http request.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: SBRL.GlidingSquirrel.Http
Assembly: GlidingSquirrel (in GlidingSquirrel.dll)
Assembly Versions: 0.0.0.0, 1.0.6562.35419, 1.0.6562.35930, 1.0.6566.37627, 1.0.6620.40465, 1.0.6629.34522, 1.0.6744.34319, 1.0.6744.34540, 1.0.6746.26208, 1.0.6746.26412, 1.0.6746.26518, 1.0.6746.26789, 1.0.6746.26804, 1.0.6746.26825, 1.0.6746.26834, 1.0.6746.26851, 1.0.6746.26854, 1.0.6746.27195, 1.0.6746.27200, 1.0.6786.21077, 1.0.6786.21083, 1.0.6786.38758, 1.0.6786.38797, 1.0.6786.38837, 1.0.6786.38901, 1.0.6786.38913, 1.0.6786.39083, 1.0.6786.39119, 1.0.6786.39136, 1.0.6786.39265

Host Property

Quick access to the host http header.

Syntax

public string Host { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: SBRL.GlidingSquirrel.Http
Assembly: GlidingSquirrel (in GlidingSquirrel.dll)
Assembly Versions: 0.0.0.0, 1.0.6562.35419, 1.0.6562.35930, 1.0.6566.37627, 1.0.6620.40465, 1.0.6629.34522, 1.0.6744.34319, 1.0.6744.34540, 1.0.6746.26208, 1.0.6746.26412, 1.0.6746.26518, 1.0.6746.26789, 1.0.6746.26804, 1.0.6746.26825, 1.0.6746.26834, 1.0.6746.26851, 1.0.6746.26854, 1.0.6746.27195, 1.0.6746.27200, 1.0.6786.21077, 1.0.6786.21083, 1.0.6786.38758, 1.0.6786.38797, 1.0.6786.38837, 1.0.6786.38901, 1.0.6786.38913, 1.0.6786.39083, 1.0.6786.39119, 1.0.6786.39136, 1.0.6786.39265

Method Field

The method used in this http request.

Syntax

public HttpMethod Method

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: SBRL.GlidingSquirrel.Http
Assembly: GlidingSquirrel (in GlidingSquirrel.dll)
Assembly Versions: 0.0.0.0, 1.0.6562.35419, 1.0.6562.35930, 1.0.6566.37627, 1.0.6620.40465, 1.0.6629.34522, 1.0.6744.34319, 1.0.6744.34540, 1.0.6746.26208, 1.0.6746.26412, 1.0.6746.26518, 1.0.6746.26789, 1.0.6746.26804, 1.0.6746.26825, 1.0.6746.26834, 1.0.6746.26851, 1.0.6746.26854, 1.0.6746.27195, 1.0.6746.27200, 1.0.6786.21077, 1.0.6786.21083, 1.0.6786.38758, 1.0.6786.38797, 1.0.6786.38837, 1.0.6786.38901, 1.0.6786.38913, 1.0.6786.39083, 1.0.6786.39119, 1.0.6786.39136, 1.0.6786.39265

MethodFromString Method

Converts a http method stored in a string to the HttpMethod enum. Multiple header defintions are concatenated in the order that they appear, delimited by a comma.

Syntax

public static HttpMethod MethodFromString (string methodText)

Parameters

methodText
The http method as a string to convert.

Returns

The http method as an enum.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: SBRL.GlidingSquirrel.Http
Assembly: GlidingSquirrel (in GlidingSquirrel.dll)
Assembly Versions: 0.0.0.0, 1.0.6562.35419, 1.0.6562.35930, 1.0.6566.37627, 1.0.6620.40465, 1.0.6629.34522, 1.0.6744.34319, 1.0.6744.34540, 1.0.6746.26208, 1.0.6746.26412, 1.0.6746.26518, 1.0.6746.26789, 1.0.6746.26804, 1.0.6746.26825, 1.0.6746.26834, 1.0.6746.26851, 1.0.6746.26854, 1.0.6746.27195, 1.0.6746.27200, 1.0.6786.21077, 1.0.6786.21083, 1.0.6786.38758, 1.0.6786.38797, 1.0.6786.38837, 1.0.6786.38901, 1.0.6786.38913, 1.0.6786.39083, 1.0.6786.39119, 1.0.6786.39136, 1.0.6786.39265

ParseFirstLine Method

Parses the first line of a http request, and return the result as a C# 7 tuple. Don't panic if your editor doesn't appear to like this - it'll compile just fine :P

Syntax

[return:System.Runtime.CompilerServices.TupleElementNames(Mono.Cecil.CustomAttributeArgument[])]
public static ValueTuple<float, HttpMethod, string> ParseFirstLine (string firstLine)

Parameters

firstLine
Documentation for this section has not yet been entered.

Returns

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: SBRL.GlidingSquirrel.Http
Assembly: GlidingSquirrel (in GlidingSquirrel.dll)
Assembly Versions: 0.0.0.0, 1.0.6562.35419, 1.0.6562.35930, 1.0.6566.37627, 1.0.6620.40465, 1.0.6629.34522, 1.0.6744.34319, 1.0.6744.34540, 1.0.6746.26208, 1.0.6746.26412, 1.0.6746.26518, 1.0.6746.26789, 1.0.6746.26804, 1.0.6746.26825, 1.0.6746.26834, 1.0.6746.26851, 1.0.6746.26854, 1.0.6746.27195, 1.0.6746.27200, 1.0.6786.21077, 1.0.6786.21083, 1.0.6786.38758, 1.0.6786.38797, 1.0.6786.38837, 1.0.6786.38901, 1.0.6786.38913, 1.0.6786.39083, 1.0.6786.39119, 1.0.6786.39136, 1.0.6786.39265

ParseHeaders Method

Parses a raw lsit of headers into a dictionary of headers keys and values.

Syntax

public static Dictionary<string, string> ParseHeaders (List<string> rawHeaders)

Parameters

rawHeaders
The raw headers to parse.

Returns

The parsed headers.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: SBRL.GlidingSquirrel.Http
Assembly: GlidingSquirrel (in GlidingSquirrel.dll)
Assembly Versions: 0.0.0.0, 1.0.6562.35419, 1.0.6562.35930, 1.0.6566.37627, 1.0.6620.40465, 1.0.6629.34522, 1.0.6744.34319, 1.0.6744.34540, 1.0.6746.26208, 1.0.6746.26412, 1.0.6746.26518, 1.0.6746.26789, 1.0.6746.26804, 1.0.6746.26825, 1.0.6746.26834, 1.0.6746.26851, 1.0.6746.26854, 1.0.6746.27195, 1.0.6746.27200, 1.0.6786.21077, 1.0.6786.21083, 1.0.6786.38758, 1.0.6786.38797, 1.0.6786.38837, 1.0.6786.38901, 1.0.6786.38913, 1.0.6786.39083, 1.0.6786.39119, 1.0.6786.39136, 1.0.6786.39265

RequestNumber Field

An incrementing value that represents the number of requests that have been made previously on the connection that this request was recieved on. Starts at 0 and is incremented by 1 each time a request is handled.

Syntax

public readonly int RequestNumber

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: SBRL.GlidingSquirrel.Http
Assembly: GlidingSquirrel (in GlidingSquirrel.dll)
Assembly Versions: 1.0.6620.40465

Url Field

The url requested by this request. Not processed according to the host header at all.

Syntax

public string Url

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: SBRL.GlidingSquirrel.Http
Assembly: GlidingSquirrel (in GlidingSquirrel.dll)
Assembly Versions: 0.0.0.0, 1.0.6562.35419, 1.0.6562.35930, 1.0.6566.37627, 1.0.6620.40465, 1.0.6629.34522, 1.0.6744.34319, 1.0.6744.34540, 1.0.6746.26208, 1.0.6746.26412, 1.0.6746.26518, 1.0.6746.26789, 1.0.6746.26804, 1.0.6746.26825, 1.0.6746.26834, 1.0.6746.26851, 1.0.6746.26854, 1.0.6746.27195, 1.0.6746.27200, 1.0.6786.21077, 1.0.6786.21083, 1.0.6786.38758, 1.0.6786.38797, 1.0.6786.38837, 1.0.6786.38901, 1.0.6786.38913, 1.0.6786.39083, 1.0.6786.39119, 1.0.6786.39136, 1.0.6786.39265

UserAgent Property

Quick access to the user-agent http header.

Syntax

public string UserAgent { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: SBRL.GlidingSquirrel.Http
Assembly: GlidingSquirrel (in GlidingSquirrel.dll)
Assembly Versions: 0.0.0.0, 1.0.6562.35419, 1.0.6562.35930, 1.0.6566.37627, 1.0.6620.40465, 1.0.6629.34522, 1.0.6744.34319, 1.0.6744.34540, 1.0.6746.26208, 1.0.6746.26412, 1.0.6746.26518, 1.0.6746.26789, 1.0.6746.26804, 1.0.6746.26825, 1.0.6746.26834, 1.0.6746.26851, 1.0.6746.26854, 1.0.6746.27195, 1.0.6746.27200, 1.0.6786.21077, 1.0.6786.21083, 1.0.6786.38758, 1.0.6786.38797, 1.0.6786.38837, 1.0.6786.38901, 1.0.6786.38913, 1.0.6786.39083, 1.0.6786.39119, 1.0.6786.39136, 1.0.6786.39265

WillAccept Method

Works out whether this request will accept a given mime type as a response.

Syntax

public bool WillAccept (string targetMimeType)

Parameters

targetMimeType
The mime type to check.

Returns

Whether the specified mime type is acceptable as a response to this request..

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: SBRL.GlidingSquirrel.Http
Assembly: GlidingSquirrel (in GlidingSquirrel.dll)
Assembly Versions: 0.0.0.0, 1.0.6562.35419, 1.0.6562.35930, 1.0.6566.37627, 1.0.6620.40465, 1.0.6629.34522, 1.0.6744.34319, 1.0.6744.34540, 1.0.6746.26208, 1.0.6746.26412, 1.0.6746.26518, 1.0.6746.26789, 1.0.6746.26804, 1.0.6746.26825, 1.0.6746.26834, 1.0.6746.26851, 1.0.6746.26854, 1.0.6746.27195, 1.0.6746.27200, 1.0.6786.21077, 1.0.6786.21083, 1.0.6786.38758, 1.0.6786.38797, 1.0.6786.38837, 1.0.6786.38901, 1.0.6786.38913, 1.0.6786.39083, 1.0.6786.39119, 1.0.6786.39136, 1.0.6786.39265