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

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

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.acHTTP1BeforeSendRequest(Sender: TObject;  
  hRequest: Pointer);  
begin  
  InternetSetOption(hRequest, INTERNET_OPTION_IGNORE_OFFLINE, nil0);  
end;