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

The HTTP response parsing context for a response fresh from the server. This context is passed into the http-parser registered callbacks. The registered callbacks are private functions of the form httpParserXXXXCallbacks(). More...

#include <core_http_client_private.h>

Data Fields

http_parser httpParser
 
HTTPParsingState_t state
 
HTTPResponse_t * pResponse
 
uint8_t isHeadResponse
 
const char * pBufferCur
 
const char * pLastHeaderField
 
size_t lastHeaderFieldLen
 
const char * pLastHeaderValue
 
size_t lastHeaderValueLen
 

Detailed Description

The HTTP response parsing context for a response fresh from the server. This context is passed into the http-parser registered callbacks. The registered callbacks are private functions of the form httpParserXXXXCallbacks().

The transitions of the httpParserXXXXCallback() functions are shown below. The XXXX is replaced by the strings in the state boxes:

+------------------—+ |onMessageBegin | +-----—+---------—+

v +-----—+---------—+ |onStatus | +-----—+---------—+

v +-----—+---------—+ |onHeaderField +<—+ +-----—+---------—+ | | | | |(More headers) | | v | +-----—+---------—+ | |onHeaderValue +-—^ +-----—+---------—+

v +-----—+---------—+ |onHeadersComplete | +------------------—+

v +-----—+---------—+ |onBody +<—+ +-----—+-----—+—+ | | | |(Transfer-encoding chunked body) | | | | +-----—+ | v +-----—+---------—+ |onMessageComplete | +------------------—+

Field Documentation

◆ httpParser

http_parser HTTPParsingContext::httpParser

Third-party http-parser context.

◆ state

HTTPParsingState_t HTTPParsingContext::state

The current state of the HTTP response parsed.

◆ pResponse

HTTPResponse_t* HTTPParsingContext::pResponse

HTTP response associated with this parsing context.

◆ isHeadResponse

uint8_t HTTPParsingContext::isHeadResponse

HTTP response is for a HEAD request.

◆ pBufferCur

const char* HTTPParsingContext::pBufferCur

The current location of the parser in the response buffer.

◆ pLastHeaderField

const char* HTTPParsingContext::pLastHeaderField

Holds the last part of the header field parsed.

◆ lastHeaderFieldLen

size_t HTTPParsingContext::lastHeaderFieldLen

The length of the last header field parsed.

◆ pLastHeaderValue

const char* HTTPParsingContext::pLastHeaderValue

Holds the last part of the header value parsed.

◆ lastHeaderValueLen

size_t HTTPParsingContext::lastHeaderValueLen

The length of the last value field parsed.


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