coreHTTP v3.1.0
HTTP/1.1 Client Library
 
Loading...
Searching...
No Matches
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.
 
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.
 
const uint8_t * pHeaders
 The starting location of the response headers in pBuffer.
 
size_t headersLen
 Byte length of the response headers in pBuffer.
 
const uint8_t * pBody
 The starting location of the response body in pBuffer.
 
size_t bodyLen
 Byte length of the body in pBuffer.
 
uint16_t statusCode
 The HTTP response Status-Code.
 
size_t contentLength
 The value in the "Content-Length" header is returned here.
 
size_t headerCount
 Count of the headers sent by the server.
 
uint8_t areHeadersComplete
 Indicates whether the HTTP response headers have been fully received.
 
uint32_t respOptionFlags
 Flags to control the behavior of response parsing.
 
uint32_t respFlags
 Flags of useful headers found in the response.
 

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.

◆ areHeadersComplete

uint8_t HTTPResponse_t::areHeadersComplete

Indicates whether the HTTP response headers have been fully received.

This variable is set to 1 after all headers have been received and processed by HTTPClient_Send.

◆ respOptionFlags

uint32_t HTTPResponse_t::respOptionFlags

Flags to control the behavior of response parsing.

Please see HTTPResponse_t Flags for more information.

◆ 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: