http OnBeforeSendRequest event
Return to Introduction  Previous page  Next page
Applies to
auHTTP component.  

Declaration
type  
  TauHTTPBeforeSendRequest = procedure(Sender: TObject; hRequest: hInternet) of object;  
 
property OnBeforeSendRequest: TauHTTPBeforeSendRequest;  

Description
The OnBeforeSendRequest event occurs just before the component sends HTTP query to the server, at once after opening the internet request (by HTTPOpenRequest function of WinInet). The hRequest parameter is the Internet handle, returned by HTTPOpenRequest and can be used to specify additional Internet options to the request.  
 
Write OnBeforeSendRequest event handler if you want to specify custom Internet options using "low level" InternetSetOptions function (from WinInet unit), to the hRequest handle.  
 
Example
procedure TForm1.auHTTP1BeforeSendRequest(Sender: TObject;  
  hRequest: Pointer);  
begin  
  InternetSetOption(hRequest, INTERNET_OPTION_IGNORE_OFFLINE, nil0);  
end;