http POSTData property
Return to Introduction  Previous page  Next page
Applies to
auHTTP component.  

Declaration
property POSTData: String;  

Description
The POSTData property specifies any optional data to send with the HTTP request. The optional data can be the resource or information being posted to the server. The POSTData property is generally used to POST some data to the CGI programs.  

Example: (requesting data from the CGI script (at Torry.net) via POST method)
procedure TForm1.ReadBtnClick(Sender: TObject);  
begin  
  auHTTP1.URL := 'http://www.torry.net/quicksearch.php';  
  auHTTP1.POSTData := 'String=HTTP&Exact=Yes&Title=No';  
  auHTTP1.Read;  
end;  
 
procedure TForm1.auHTTP1Done(Sender: TObject; ContentType: string; FileSize: Integer; Stream: TStream);  
begin  
  // Receiving content from Stream  
end;  

iiinfo Remarks
1.When you trying to POST data to the CGI program specifying the POSTData property, make sure that RequestMethod has set to rmAutoDetect or rmPOST;  
2.The auHTTP component unable to post data to the CGI program when user working offline (even if user connected to the Internet). In this case, when you call the Read method, the OnHostUnreachable event occurs. Posting to the CGI programs requires active Internet connection.  

See also
RequestMethod property and Read method.