Class THttpCli (unit HttpProt)

Inherits from

TComponent

Constructors


constructor Create(Aowner:TComponent);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


Functions

procedure Abort;

Asynchronous, non-blocking Head

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


destructor Destroy;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure Get;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} { This will start the Get process and wait until terminated (blocking)

procedure GetASync;

Synchronous blocking Head

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} { This will start the get process and returns immediately (non blocking)


procedure Head;

Synchronous blocking Post

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} { This will start the Head process and wait until terminated (blocking)


procedure HeadASync;

Asynchronous, non-blocking Post

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} { This will start the head process and returns immediately (non blocking)


procedure Post;

Synchronous blocking Get

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} { This will start the Post process and wait until terminated (blocking)


procedure PostASync;

Asynchronous, non-blocking Get

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} { This will start the post process and returns immediately (non blocking)


procedure DoRequestAsync(Rq : THttpRequest);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure DoRequestSync(Rq : THttpRequest);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure GetBodyLineNext;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure GetHeaderLineNext;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure LocationSessionClosed(Sender: TObject; Error: Word);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure Login;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure Logout;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure SendCommand(const Cmd : String);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure SendRequest(const method,Version: String);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure SetMultiThreaded(newValue : Boolean);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure SetReady;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure SocketDataAvailable(Sender: TObject; Error: Word);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure SocketDataSent(Sender : TObject; Error : Word);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure SocketDNSLookupDone(Sender: TObject; Error: Word);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure SocketSessionClosed(Sender: TObject; Error: Word);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure SocketSessionConnected(Sender : TObject; Error : Word);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure StateChange(NewState : THttpState);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure TriggerDocBegin;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure TriggerDocData(Data : Pointer; Len : Integer);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure TriggerDocEnd;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure TriggerHeaderBegin;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure TriggerHeaderEnd;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure TriggerRequestDone;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure TriggerSendBegin;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure TriggerSendData(Data : Pointer; Len : Integer);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure TriggerSendEnd;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure TriggerStateChange;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure WMHttpLogin(var msg: TMessage);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure WMHttpRequestDone(var msg: TMessage);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure WMHttpSetReady(var msg: TMessage);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

procedure WndProc(var MsgRec: TMessage);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Properties

property Agent : String


property ContentTypePost : String


property Cookie : String


property ModifiedSince : TDateTime


property MultiThreaded : Boolean


property NoCache : Boolean


property Password : String


property Proxy : String


property ProxyPassword : String


property ProxyPort : String


property ProxyUsername : String


property Reference : String


property Sender : String


property URL : String


property Username : String


property AuthorizationRequest : TStringList


property ContentLength : LongInt


property ContentType : String


property DocName : String


property Handle : HWND


property LastResponse : String


property RcvdCount : LongInt


property RcvdHeader : TStrings


property RcvdStream : TStream


property ReasonPhrase : String


property SendStream : TStream


property SentCount : LongInt


property State : THttpState


property StatusCode : Integer


property WSocket : TWSocket


Events

event OnCommand : TOnCommand


event OnDocBegin : TNotifyEvent


event OnDocData : TDocDataEvent


event OnDocEnd : TNotifyEvent


event OnHeaderBegin : TNotifyEvent


event OnHeaderData : TNotifyEvent


event OnHeaderEnd : TNotifyEvent


event OnLocationChange : TNotifyEvent


event OnRequestDone : THttpRequestDone


event OnSendBegin : TNotifyEvent


event OnSendData : TDocDataEvent


event OnSendEnd : TNotifyEvent


event OnStateChange : TNotifyEvent


event OnTrace : TNotifyEvent


Variables

FAgent : String;


FAllowedToSend : Boolean;


FBodyLineCount : Integer;


FConnected : Boolean;


FContentLength : LongInt;


FContentPost : String;


FContentType : String;


FCookie : String;


FDoAuthor : TStringList;


FDocName : String;


FHeaderLineCount : Integer;


FHostName : String;


FLastResponse : String;


FLocationFlag : Boolean;


FModifiedSince : TDateTime;


FMultiThreaded : Boolean;


FNext : procedure of object;


FNoCache : Boolean;

Warning ! Use GMT date/Time

FOnCommand : TOnCommand;


FOnDataAvailable : TDataAvailable;


FOnDocBegin : TNotifyEvent;


FOnDocData : TDocDataEvent;


FOnDocEnd : TNotifyEvent;


FOnHeaderBegin : TNotifyEvent;


FOnHeaderData : TNotifyEvent;


FOnHeaderEnd : TNotifyEvent;


FOnLocationChange : TNotifyEvent;


FOnRequestDone : THttpRequestDone;


FOnSendBegin : TNotifyEvent;


FOnSendData : TDocDataEvent;


FOnSendEnd : TNotifyEvent;


FOnStateChange : TNotifyEvent;


FOnTrace : TNotifyEvent;


FPassword : String;


FPath : String;


FPort : String;


FProxy : String;


FProxyPassword : String;


FProxyPort : String;


FProxyUsername : String;


FRcvdCount : LongInt;

If assigned, will received the answer

FRcvdHeader : TStrings;


FRcvdStream : TStream;


FReasonPhrase : String;


FReceiveBuffer : array [0..HTTP_RCV_BUF_SIZE - 1] of char;


FReceiveLen : Integer;


FReference : String;


FReqStream : TMemoryStream;

Contains the data to send

FRequestDoneError : Integer;


FRequestType : THttpRequest;


FSendBuffer : array [0..HTTP_SND_BUF_SIZE - 1] of char;


FSender : String;


FSendStream : TStream;


FSentCount : LongInt;

Number of received bytes for the body

FState : THttpState;


FStatusCode : Integer;


FTargetHost : String;


FURL : String;


FUsername : String;


FWindowHandle : HWND;


FWSocket : TWSocket;



Constructors


constructor Create(Aowner:TComponent);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


Functions


procedure Abort;

Asynchronous, non-blocking Head

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


destructor Destroy;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure Get;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} { This will start the Get process and wait until terminated (blocking)


procedure GetASync;

Synchronous blocking Head

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} { This will start the get process and returns immediately (non blocking)


procedure Head;

Synchronous blocking Post

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} { This will start the Head process and wait until terminated (blocking)


procedure HeadASync;

Asynchronous, non-blocking Post

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} { This will start the head process and returns immediately (non blocking)


procedure Post;

Synchronous blocking Get

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} { This will start the Post process and wait until terminated (blocking)


procedure PostASync;

Asynchronous, non-blocking Get

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} { This will start the post process and returns immediately (non blocking)


procedure DoRequestAsync(Rq : THttpRequest);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure DoRequestSync(Rq : THttpRequest);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure GetBodyLineNext;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure GetHeaderLineNext;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure LocationSessionClosed(Sender: TObject; Error: Word);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure Login;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure Logout;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure SendCommand(const Cmd : String);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure SendRequest(const method,Version: String);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure SetMultiThreaded(newValue : Boolean);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure SetReady;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure SocketDataAvailable(Sender: TObject; Error: Word);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure SocketDataSent(Sender : TObject; Error : Word);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure SocketDNSLookupDone(Sender: TObject; Error: Word);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure SocketSessionClosed(Sender: TObject; Error: Word);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure SocketSessionConnected(Sender : TObject; Error : Word);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure StateChange(NewState : THttpState);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure TriggerDocBegin;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure TriggerDocData(Data : Pointer; Len : Integer);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure TriggerDocEnd;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure TriggerHeaderBegin;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure TriggerHeaderEnd;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure TriggerRequestDone;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure TriggerSendBegin;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure TriggerSendData(Data : Pointer; Len : Integer);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure TriggerSendEnd;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure TriggerStateChange;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure WMHttpLogin(var msg: TMessage);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure WMHttpRequestDone(var msg: TMessage);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure WMHttpSetReady(var msg: TMessage);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


procedure WndProc(var MsgRec: TMessage);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


Properties


property Agent : String


property ContentTypePost : String


property Cookie : String


property ModifiedSince : TDateTime


property MultiThreaded : Boolean


property NoCache : Boolean


property Password : String


property Proxy : String


property ProxyPassword : String


property ProxyPort : String


property ProxyUsername : String


property Reference : String


property Sender : String


property URL : String


property Username : String


property AuthorizationRequest : TStringList


property ContentLength : LongInt


property ContentType : String


property DocName : String


property Handle : HWND


property LastResponse : String


property RcvdCount : LongInt


property RcvdHeader : TStrings


property RcvdStream : TStream


property ReasonPhrase : String


property SendStream : TStream


property SentCount : LongInt


property State : THttpState


property StatusCode : Integer


property WSocket : TWSocket


Events


event OnCommand : TOnCommand


event OnDocBegin : TNotifyEvent


event OnDocData : TDocDataEvent


event OnDocEnd : TNotifyEvent


event OnHeaderBegin : TNotifyEvent


event OnHeaderData : TNotifyEvent


event OnHeaderEnd : TNotifyEvent


event OnLocationChange : TNotifyEvent


event OnRequestDone : THttpRequestDone


event OnSendBegin : TNotifyEvent


event OnSendData : TDocDataEvent


event OnSendEnd : TNotifyEvent


event OnStateChange : TNotifyEvent


event OnTrace : TNotifyEvent


Variables


FAgent : String;


FAllowedToSend : Boolean;


FBodyLineCount : Integer;


FConnected : Boolean;


FContentLength : LongInt;


FContentPost : String;


FContentType : String;


FCookie : String;


FDoAuthor : TStringList;


FDocName : String;


FHeaderLineCount : Integer;


FHostName : String;


FLastResponse : String;


FLocationFlag : Boolean;


FModifiedSince : TDateTime;


FMultiThreaded : Boolean;


FNext : procedure of object;


FNoCache : Boolean;

Warning ! Use GMT date/Time


FOnCommand : TOnCommand;


FOnDataAvailable : TDataAvailable;


FOnDocBegin : TNotifyEvent;


FOnDocData : TDocDataEvent;


FOnDocEnd : TNotifyEvent;


FOnHeaderBegin : TNotifyEvent;


FOnHeaderData : TNotifyEvent;


FOnHeaderEnd : TNotifyEvent;


FOnLocationChange : TNotifyEvent;


FOnRequestDone : THttpRequestDone;


FOnSendBegin : TNotifyEvent;


FOnSendData : TDocDataEvent;


FOnSendEnd : TNotifyEvent;


FOnStateChange : TNotifyEvent;


FOnTrace : TNotifyEvent;


FPassword : String;


FPath : String;


FPort : String;


FProxy : String;


FProxyPassword : String;


FProxyPort : String;


FProxyUsername : String;


FRcvdCount : LongInt;

If assigned, will received the answer


FRcvdHeader : TStrings;


FRcvdStream : TStream;


FReasonPhrase : String;


FReceiveBuffer : array [0..HTTP_RCV_BUF_SIZE - 1] of char;


FReceiveLen : Integer;


FReference : String;


FReqStream : TMemoryStream;

Contains the data to send


FRequestDoneError : Integer;


FRequestType : THttpRequest;


FSendBuffer : array [0..HTTP_SND_BUF_SIZE - 1] of char;


FSender : String;


FSendStream : TStream;


FSentCount : LongInt;

Number of received bytes for the body


FState : THttpState;


FStatusCode : Integer;


FTargetHost : String;


FURL : String;


FUsername : String;


FWindowHandle : HWND;


FWSocket : TWSocket;