ClintHeyer.Httpd
Class HttpRequest

A HTTP Request for a resource

Field Summary
ClintHeyer.Httpd.Context context
string credentials
System.Collections.ArrayList data
System.Collections.Hashtable headers
bool keepAlive
ClintHeyer.Httpd.HttpMethod method
System.Collections.Hashtable parameters
string request
ClintHeyer.Httpd.HttpSession session
ClintHeyer.Httpd.URI uri
ClintHeyer.Httpd.HttpVersion version

Constructor Summary
HttpRequest(string request, System.Collections.Hashtable headers, ClintHeyer.Httpd.HttpMethod method, ClintHeyer.Httpd.HttpVersion version, System.Collections.ArrayList data)

Property Summary
ClintHeyer.Httpd.Context Context
         Gets the Context this request originated from
string Credentials
System.Collections.ArrayList Data
         Gets the data in this request
ClintHeyer.Httpd.HttpVersion HttpVersion
         Gets the HTTP version of this request
bool KeepAlive
         Gets whether KeepAlive HTTP option is set
ClintHeyer.Httpd.HttpMethod Method
         Gets the HTTP method
string RemoteHost
         Gets the name the remote host used for itself (may not be true)
string Request
         Gets the original request string
ClintHeyer.Httpd.HttpSession Session
         Gets the session for this request, if any
ClintHeyer.Httpd.URI URI
         Gets the URI for this request
string UserAgent
         Gets the UserAgent HTTP header

Method Summary
string GetHeader(string key)
         Gets the specified header, or null if it doesn't exist
System.Int64[,] GetRange(string range)
         Parses byte range data
ClintHeyer.Httpd.HttpRequest Parse(byte[] data)
         Parses raw data into a request
System.Collections.ArrayList ParseData(byte[] data)
void ParseURI()
void SetContext(ClintHeyer.Httpd.Context c)
         Sets the context for this request
void SetSession(ClintHeyer.Httpd.HttpSession session)
         Sets the session for this request

Methods inherited from class System.Object
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString


Field Detail

context

private ClintHeyer.Httpd.Context context


credentials

private string credentials


data

private System.Collections.ArrayList data


headers

private System.Collections.Hashtable headers


keepAlive

private bool keepAlive


method

private ClintHeyer.Httpd.HttpMethod method


parameters

private System.Collections.Hashtable parameters


request

private string request


session

private ClintHeyer.Httpd.HttpSession session


uri

private ClintHeyer.Httpd.URI uri


version

private ClintHeyer.Httpd.HttpVersion version

Constructor Detail

HttpRequest

private HttpRequest(string request,
                    System.Collections.Hashtable headers,
                    ClintHeyer.Httpd.HttpMethod method,
                    ClintHeyer.Httpd.HttpVersion version,
                    System.Collections.ArrayList data)

Property Detail

Context

public ClintHeyer.Httpd.Context Context

Gets the Context this request originated from

Will normally be the context that handled original request, but could be server


Credentials

public string Credentials


Data

public System.Collections.ArrayList Data

Gets the data in this request


HttpVersion

public ClintHeyer.Httpd.HttpVersion HttpVersion

Gets the HTTP version of this request


KeepAlive

public bool KeepAlive

Gets whether KeepAlive HTTP option is set


Method

public ClintHeyer.Httpd.HttpMethod Method

Gets the HTTP method


RemoteHost

public string RemoteHost

Gets the name the remote host used for itself (may not be true)


Request

public string Request

Gets the original request string


Session

public ClintHeyer.Httpd.HttpSession Session

Gets the session for this request, if any


URI

public ClintHeyer.Httpd.URI URI

Gets the URI for this request


UserAgent

public string UserAgent

Gets the UserAgent HTTP header

Method Detail

GetHeader

public string GetHeader(string key)

Gets the specified header, or null if it doesn't exist

Parameters:
key - Key
Returns:
Value, or null if key is not in header

GetRange

public System.Int64[,] GetRange(string range)

Parses byte range data

Parameters:
range - Range header
Returns:
Nested array of ranges

Parse

public ClintHeyer.Httpd.HttpRequest Parse(byte[] data)

Parses raw data into a request

Parameters:
data - Data
Returns:
Request
Throws:
ClintHeyer.Httpd.MalformedRequestException - Data does not contain a valid request

ParseData

private System.Collections.ArrayList ParseData(byte[] data)


ParseURI

private void ParseURI()


SetContext

internal void SetContext(ClintHeyer.Httpd.Context c)

Sets the context for this request

Parameters:
c - Context

SetSession

internal void SetSession(ClintHeyer.Httpd.HttpSession session)

Sets the session for this request

Parameters:
session -