This callback is called when the HTTP request is completed. If the callback on_data_read() is specified, the variable response->data will be set to NULL, otherwise it will contain the complete data. Response data is allocated from pj_http_req's internal memory pool so the data remain valid as long as pj_http_req is not destroyed and application does not start a new request.
If no longer required, application may choose to destroy pj_http_req immediately by calling pj_http_req_destroy() inside the callback.
Parameters
http_req
The http request.
status
The status of the request operation. PJ_SUCCESS if the operation completed successfully (connection-wise). To check the server's status-code response to the HTTP request, application should check resp->status_code instead.
resp
The response of the corresponding request. If the status argument is non-PJ_SUCCESS, this argument will be set to NULL.
This callback is called when a segment of response body data arrives. If this callback is specified (i.e. not NULL), the on_complete() callback will be called with zero-length data (within the response parameter), hence the application must store and manage its own data buffer, otherwise the on_complete() callback will be called with the response parameter containing the complete data.
This callback is called when the HTTP request is ready to send its request body. Application may wish to use this callback if it wishes to load the data at a later time or if it does not wish to load the whole data into memory. In order for this callback to be called, application MUST set http_req_param.total_size to a value greater than 0.
Parameters
http_req
The http request.
data
Pointer to the data that will be sent. Application must set the pointer to the current data chunk/segment to be sent. Data must remain valid until the next on_send_data() callback or for the last segment, until it is sent.
size
Pointer to the data size that will be sent.
The documentation for this struct was generated from the following file:
PJLIB-UTIL Open Source, small footprint, and portable asynchronous/caching DNS resolver, text scanner, STUN client, and XML library
Copyright (C) 2006-2009 Teluu Inc.