AGK for Pascal
TAgkHttpConnection.SendRequestASync Method (String, String)

Send an asynchronous request to the server connected to using Connect.

procedure SendRequestASync(const ServerFile: String; const PostData: String = ''); overload;
const ServerFile: String 
The file to request from the server, include everything after the domain part of the URL. 
const PostData: String = '' 
(optional) The raw post data to send to the server. Note that & and = are special characters that separate variables. 

For example if requesting, ServerFile should be 'index.php'. Also allows you to send POST data to the server which can include variables or file data, e.g. 'myvar=5&var2=test'. This method returns immediately and waits for the server to reply in the background. 

You can check the status of the reply with ResponseReady and when it is ready retrieve the response with Response

There is also a version of SendRequestASync that fires an event instead when the response is available.

Copyright (c) 2012. All rights reserved.