C# Класс Org.Mentalis.Proxy.Http.HttpClient

Relays HTTP data between a remote host and a local client.
This class supports both HTTP and HTTPS.
Наследование: Org.Mentalis.Proxy.Client
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
IsValidQuery bool
OnConnected void
OnErrorSent void
OnOkSent void
OnQuerySent void
OnReceiveQuery void
ParseQuery System.Collections.Specialized.StringDictionary
ProcessQuery void
RebuildQuery string
SendBadRequest void

Открытые методы

Метод Описание
HttpClient ( Socket ClientSocket, DestroyDelegate Destroyer ) : System

Initializes a new instance of the HttpClient class.

StartHandshake ( ) : void

Starts receiving data from the client connection.

ToString ( ) : string

Returns text information about this HttpClient object.

ToString ( bool WithUrl ) : string

Returns text information about this HttpClient object.

Приватные методы

Метод Описание
IsValidQuery ( string Query ) : bool

Checks whether a specified string is a valid HTTP query string.

OnConnected ( IAsyncResult ar ) : void

Called when we're connected to the requested remote host.

OnErrorSent ( IAsyncResult ar ) : void

Called when the Bad Request error has been sent to the client.

OnOkSent ( IAsyncResult ar ) : void

Called when an OK reply has been sent to the local client.

OnQuerySent ( IAsyncResult ar ) : void

Called when the HTTP query has been sent to the remote host.

OnReceiveQuery ( IAsyncResult ar ) : void

Called when we received some data from the client connection.

ParseQuery ( string Query ) : StringDictionary

Parses a specified HTTP query into its header fields.

ProcessQuery ( string Query ) : void

Processes a specified query and connects to the requested HTTP web server.

If there's an error while processing the HTTP request or when connecting to the remote server, the Proxy sends a "400 - Bad Request" error to the client.

RebuildQuery ( ) : string

Rebuilds the HTTP query, starting from the HttpRequestType, RequestedPath, HttpVersion and HeaderFields properties.

SendBadRequest ( ) : void

Sends a "400 - Bad Request" error to the client.

Описание методов

HttpClient() публичный Метод

Initializes a new instance of the HttpClient class.
public HttpClient ( Socket ClientSocket, DestroyDelegate Destroyer ) : System
ClientSocket Socket The Socket connection between this proxy server and the local client.
Destroyer DestroyDelegate The callback method to be called when this Client object disconnects from the local client and the remote server.
Результат System

StartHandshake() публичный Метод

Starts receiving data from the client connection.
public StartHandshake ( ) : void
Результат void

ToString() публичный Метод

Returns text information about this HttpClient object.
public ToString ( ) : string
Результат string

ToString() публичный Метод

Returns text information about this HttpClient object.
public ToString ( bool WithUrl ) : string
WithUrl bool Specifies whether or not to include information about the requested URL.
Результат string