Skip to Content

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 postData argument is NULL, the request will be sent as a GET request.
  • When postData is not NULL, 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 handler callback to be able to identify this request.

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 handler callback to be able to identify this request.

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

Back to bzfs API Functions

This content is maintained on GitHub. We welcome any feedback and improvements!

Give us Feedback Edit this Page