coreHTTP v2.0.0
HTTP/1.1 Client Library
HTTPResponse_t Struct Reference

Represents an HTTP response. More...

#include <core_http_client.h>

Data Fields

uint8_t * pBuffer
 Buffer for both the raw HTTP header and body. More...
 
size_t bufferLen
 
HTTPClient_ResponseHeaderParsingCallback_tpHeaderParsingCallback
 Optional callback for intercepting the header during the first parse through of the response as is it receive from the network. Set to NULL to disable.
 
HTTPClient_GetCurrentTimeFunc_t getTime
 Optional callback for getting the system time. More...
 
const uint8_t * pHeaders
 The starting location of the response headers in pBuffer. More...
 
size_t headersLen
 Byte length of the response headers in pBuffer. More...
 
const uint8_t * pBody
 The starting location of the response body in pBuffer. More...
 
size_t bodyLen
 Byte length of the body in pBuffer. More...
 
uint16_t statusCode
 The HTTP response Status-Code. More...
 
size_t contentLength
 The value in the "Content-Length" header is returned here. More...
 
size_t headerCount
 Count of the headers sent by the server. More...
 
uint32_t respFlags
 Flags of useful headers found in the response. More...
 

Detailed Description

Represents an HTTP response.

Field Documentation

◆ pBuffer

uint8_t* HTTPResponse_t::pBuffer

Buffer for both the raw HTTP header and body.

This buffer is supplied by the application.

This buffer is owned by the library during HTTPClient_Send and HTTPClient_ReadHeader. This buffer should not be modified until after these functions return.

For optimization this buffer may be used with the request headers. The request header buffer is configured in HTTPRequestHeaders_t.pBuffer. When the same buffer is used for the request headers, HTTPClient_Send will send the headers in the buffer first, then fill the buffer with the response message.

◆ bufferLen

size_t HTTPResponse_t::bufferLen

The length of the response buffer in bytes.

◆ getTime

HTTPClient_GetCurrentTimeFunc_t HTTPResponse_t::getTime

Optional callback for getting the system time.

This is used to calculate the elapsed time when retrying network reads or sends that return zero bytes received or sent, respectively. If this field is set to NULL, then network send and receive won't be retried after a zero is returned.

If this function is set, then the maximum time for retrying network reads that return zero bytes can be set through HTTP_RECV_RETRY_TIMEOUT_MS.

If this function is set, then the maximum elapsed time between network sends greater than zero is set in HTTP_SEND_RETRY_TIMEOUT_MS.

◆ pHeaders

const uint8_t* HTTPResponse_t::pHeaders

The starting location of the response headers in pBuffer.

This is updated by HTTPClient_Send.

◆ headersLen

size_t HTTPResponse_t::headersLen

Byte length of the response headers in pBuffer.

This is updated by HTTPClient_Send.

◆ pBody

const uint8_t* HTTPResponse_t::pBody

The starting location of the response body in pBuffer.

This is updated by HTTPClient_Send.

◆ bodyLen

size_t HTTPResponse_t::bodyLen

Byte length of the body in pBuffer.

This is updated by HTTPClient_Send.

◆ statusCode

uint16_t HTTPResponse_t::statusCode

The HTTP response Status-Code.

This is updated by HTTPClient_Send.

◆ contentLength

size_t HTTPResponse_t::contentLength

The value in the "Content-Length" header is returned here.

This is updated by HTTPClient_Send.

◆ headerCount

size_t HTTPResponse_t::headerCount

Count of the headers sent by the server.

This is updated by HTTPClient_Send.

◆ respFlags

uint32_t HTTPResponse_t::respFlags

Flags of useful headers found in the response.

This is updated by HTTPClient_Send. Please see HTTPResponse_t Flags for more information.


The documentation for this struct was generated from the following file: