FreeRTOS: HTTPS Client
HTTPS Client v1.0.0 library
Return to main page ↑
IotHttpsClient_ReadResponseBody

Read the HTTPS response body from the network.

uint8_t * pBuf,
uint32_t * pLen );

This is intended to be used with an asynchronous response, this is to be invoked during the IotHttpsClientCallbacks_t.readReadyCallback to read data directly from the network into pBuf. Example Asynchronous Code

void applicationDefined_readReadyCallback(void * pPrivData, IotHttpsRequestHandle_t handle, IotHttpsReturnCode_t rc, uint16_t status)
{
...
char * myBuf = STORE_ADDRESS;
uint32_t len = STORE_READ_SIZE;
IotHttpsClient_ReadResponseBody(handle, myBuf, &len);
...
}

For a syncrhonous response, to retrieve the response body applications must directly refer to the memory configured to receive the response body: IotHttpsSyncInfo_t.pBody in IotHttpsResponseInfo_t.pSyncInfo. Otherwise this function will return an IOT_HTTPS_INVALID_PARAMETER error code. This function is intended to read the response entity body from the network and the synchronous response process handles all of that in IotHttpsClient_SendSync.

Parameters
[in]respHandle- Unique handle representing the HTTPS response.
[out]pBuf- Pointer to the response body memory location. This is not a char* because the body may have binary data.
[in,out]pLen- The length of the response to read. This should not exceed the size of the buffer that we are reading into. This will be replace with the amount of data read upon return.
Returns
One of the following:
IotHttpsResponseHandle_t
struct _httpsResponse * IotHttpsResponseHandle_t
Opaque handle of an HTTP response.
Definition: iot_https_types.h:280
IotHttpsRequestHandle_t
struct _httpsRequest * IotHttpsRequestHandle_t
Opaque handle of an HTTP request.
Definition: iot_https_types.h:263
IotHttpsClient_ReadResponseBody
IotHttpsReturnCode_t IotHttpsClient_ReadResponseBody(IotHttpsResponseHandle_t respHandle, uint8_t *pBuf, uint32_t *pLen)
Read the HTTPS response body from the network.
Definition: iot_https_client.c:3109
IotHttpsReturnCode_t
IotHttpsReturnCode_t
Return codes of HTTPS Client functions.
Definition: iot_https_types.h:294