bz_addURLJob()
Available since 2.4.0
This URL function will send an asynchronous outgoing GET or POST request to a given URL.
- When the
postDataargument isNULL, the request will be sent as a GET request. - When
postDatais notNULL, the request is sent as a POST request.
The handler argument defines a class with callbacks that will be executed when a URL job completes or errors out.
Usage
bool bz_addURLJob(const char* URL, bz_BaseURLHandler* handler = NULL, const char* postData = NULL)
| Parameters | ||
|---|---|---|
| const char* |
URL
|
The URL to send a request to. |
| bz_BaseURLHandler* |
handler
|
This handler defines the callbacks used for when a URL job is done, errors out, or times out. |
| const char* |
postData
|
The body of a POST request; this can be in any string based format. |
bool bz_addURLJob(const char* URL, bz_URLHandler_V2* handler, void* token, const char* postData = NULL)
| Parameters | ||
|---|---|---|
| const char* |
URL
|
The URL to send a request to. |
| bz_URLHandler_V2* |
handler
|
This handler defines the callbacks used for when a URL job is done, errors out, or times out. |
| void* |
token
|
Any type of identifying information that will be accessible to the |
| const char* |
postData
|
The body of a POST request; this can be in any string based format. |
bool bz_addURLJob(const char* URL, bz_URLHandler_V2* handler, void* token, const char* postData = NULL, bz_APIStringList* headers = NULL)
| Parameters | ||
|---|---|---|
| const char* |
URL
|
The URL to send a request to. |
| bz_URLHandler_V2* |
handler
|
This handler defines the callbacks used for when a URL job is done, errors out, or times out. |
| void* |
token
|
Any type of identifying information that will be accessible to the |
| const char* |
postData
|
The body of a POST request; this can be in any string based format. |
| bz_APIStringList* |
headers
|
Key/value pairs for headers that will be sent on outgoing URL requests. |
Returns
bool
Other URL Jobs Functions
This content is maintained on GitHub. We welcome any feedback and improvements!