http Read method
Return to Introduction  Previous page  Next page
Applies to
auHTTP component.  

function Read(ForceWaitThread: Boolean = False): Boolean; // returns False if busy OR WaitTimeout expired  

The Read method initiate the HTTP request to download the data from location specified in the URL property. Function returns False if component currently busy (already processing request), OR WaitTimeout is expired (if you waiting for completion of request in the function that calls this medod, using WaitThread property).  
The ForceWaitThread is optional (not necessary to specify) parameter, which can temporary set WaitThread to True for only current call of Read method.  

Example (code demonstrates how to search for 'HTTP' keyword in
procedure TForm1.ReadBtnClick(Sender: TObject);  
  auHTTP1.URL := '';  
  auHTTP1.POSTData := 'String=HTTP&Exact=Yes&Title=No';  

C++ Builder:  
void __fastcall TForm1::ReadBtnClick(TObject *Sender)  
  auHTTP1->URL = "";  
  auHTTP1->POSTData = "String=HTTP&Exact=Yes&Title=No";  

iiwarning The Read method fails and OnHostUnreachable event occurs if you're trying to POST some data to the CGI but user currently working offline (even if connection to the Internet present). Posting to the CGI programs requires active Internet connection.  

See also
URL, RequestMethod, POSTData and Busy properties;  
WaitThread and WaitTimeout properties;  
Upload, Abort, Pause and Resume methods;  
HTTPReadString function.