ghttpGetEx

GameSpy SDK

ghttpGetEx

Make a HTTP GET request and save the response to memory.

GHTTPRequest ghttpGetEx(
const gsi_char * URL,
const gsi_char * headers,
char * buffer,
int bufferSize,
GHTTPPost post,
GHTTPBool throttle,
GHTTPBool blocking,
ghttpProgressCallback progressCallback,
ghttpCompletedCallback completedCallback,
void * param );
RoutineRequired HeaderDistribution
ghttpGetEx<ghttp.h>SDKZIP

Return Value

If less than 0, the request failed and this is a GHTTPRequestError value. Otherwise it identifies the request.

Parameters

URL
[in] URL
headers
[in] Optional headers to pass with the request. Can be NULL or "".
buffer
[in] Optional user-supplied buffer. Set to NULL to have one allocated. Must be (size+1) to allow null terminating character.
bufferSize
[in] The size of the user-supplied buffer in bytes. 0 if buffer is NULL.
post
[in] Optional data to be posted. Can be NULL.
throttle
[in] If true, throttle this connection's download speed.
blocking
[in] If true, this call doesn't return until the file has been received.
progressCallback
[in] Called periodically with progress updates. Can be NULL.
completedCallback
[in] Called when the file has been received. Can be NULL.
param
[in] Optional free-format user data for use by the callback

Remarks

This function is used to download the contents of a web page to memory. The application can provide the memory by supplying a buffer to this function, or the SDK can be allocate the memory internally.
Use ghttpGet for a simpler version of this function.