Send an asynchronous request to the server connected to using Connect and fires a notification event when the response is received.
procedure SendRequestASync(const OnResponse: TAgkHttpResponseEvent; const ServerFile: String; const PostData: String = ''); overload;
Parameters |
Description |
const OnResponse: TAgkHttpResponseEvent |
The event that is fired when the response is available. |
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 http://www.thegamecreators.com/index.php, 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.
When the response is available, the OnResponse event is fired. The Connection parameter of the event will be this connection. The Response parameter is the server reply.
There is also a version of SendRequestASync that does not use an event, but requires you to poll for the response instead.
Copyright (c) 2012. All rights reserved.
|