int NetSend(char *url, int(*callback)(int event, char *response, int length));
Sends a network request to the specified URL. The response will be handled by the callback provided.
Returns value not used.
The URL to which to send the request. Data to be sent to the server goes on the URL after a question mark symbol, with name / value pairs separated by ampersands, e.g. http://www.somesite.com/getdata?name=bob&age=35". In the example, you would be sending a name value of "bob" and an age value of "35" to the server for processing by "getdata".
The function that will receive the response from the server.
Indicates the result of the request. A value of zero indicates the request failed. A value of one indicates the request was successful.
Contains a character buffer that is the response from the server.
Indicates the length of the response buffer.
NetSend() allows you to send a request to a server and provide a callback to receive the response from the server.
Available in DragonFireSDK 1.3 and later.
int OnResponse(int event, char *response, int length)
// Display as much of the server response as possible.
// Set LandscapeMode() so we can see as much data as possible.
// Request weather data from google.com for my city.
// Set up a font and a text to display the data.
MyFont = FontAdd("Helvetica", "Regular", 12, 0x00FF00);
MyText = TextAdd(0, 0, "Response", MyFont);