CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
Loading...
Searching...
No Matches
cmlabs::HTTPRequest Class Reference

A parsed or generated HTTP request (also used for WebSocket upgrade handshakes). More...

#include <NetworkProtocols.h>

Collaboration diagram for cmlabs::HTTPRequest:
[legend]

Public Member Functions

 HTTPRequest (uint64 source=0, uint64 startRecTime=0)
 Construct an empty request.
 HTTPRequest (HTTPRequest *req)
 Deep-copy constructor.
virtual ~HTTPRequest ()
bool processHeader (const char *buffer, uint32 size, bool &isInvalid)
 Parse the HTTP header block from raw bytes.
bool processContent (const char *buffer, uint32 size)
 Append body bytes after the header has been parsed.
const char * getHeaderEntry (const char *entry)
 Look up a header field (case-insensitive).
const char * getRequest ()
const char * getURI ()
const char * getProtocol ()
std::string decodeBasicAuthorization ()
 Decode the Basic Authorization header.
const char * getBasicAuthorization ()
std::string getBasicAuthorizationUser ()
std::string getBasicAuthorizationPassword ()
bool setBasicAuthorization (const char *authB64)
 Set the Authorization header from a pre-encoded base64 credential.
bool setBasicAuthorization (const char *user, const char *password)
 Set the Authorization header from plaintext credentials (encoded internally).
const char * getParameter (const char *entry)
 Look up a URI query or form parameter by name.
const char * getPostData (const char *entry, uint32 &size, const char **type)
 Get a multipart POST part's content, size and MIME type.
const char * getPostData (const char *entry, uint32 &size)
 Get a multipart POST part's content and size.
const char * getPostDataType (const char *entry)
bool parseURIParameters (const char *text)
 Parse "a=1&b=2" style parameters from a URI query string into ::params.
bool parseContentParameters (const char *content, uint32 size)
 Parse a URL-encoded form body into ::params.
bool parseContentChunk (const char *chunk, uint32 size)
 Parse one chunk of a multipart body (between boundaries) into ::postEntries.
DataMessageconvertToMessage ()
 Convert this HTTP request into a binary DataMessage (URI, params and content mapped to message fields) for handing into message-based systems.
bool isWebsocketUpgrade ()
const char * getContent (uint32 &size)
 Get the (decoded) request body.
const char * getRawContent (uint32 &size)
 Get the raw, untransformed body bytes as received.
bool createRequest (uint8 type, const char *host, const char *uri, const char *content, uint32 contentSize, bool keepAlive, uint64 ifModifiedSince)
 Build a simple request with optional raw body.
bool createRequest (uint8 type, const char *host, const char *uri, std::map< std::string, std::string > &headerEntries, bool keepAlive, uint64 ifModifiedSince)
 Build a request with custom header fields and no body.
bool createRequest (uint8 type, const char *host, const char *uri, std::map< std::string, std::string > &headerEntries, const char *content, const char *contentType, uint32 contentSize, bool keepAlive, uint64 ifModifiedSince)
 Build a request with custom headers and a typed raw body.
bool createRequest (uint8 type, const char *host, const char *uri, std::map< std::string, std::string > &headerEntries, HTTPPostEntry *bodyEntry, bool keepAlive, uint64 ifModifiedSince)
 Build a request whose body is a single form entry.
bool createMultipartRequest (uint8 type, const char *host, const char *uri, std::map< std::string, std::string > &headerEntries, std::map< std::string, HTTPPostEntry * > &bodyEntries, bool keepAlive, uint64 ifModifiedSince)
 Build a multipart/form-data request from several named parts.
bool createWebsocketRequest (const char *uri, const char *host, const char *protocolName, const char *origin)
 Fill this object with a WebSocket upgrade handshake request.
uint32 getSize ()

Static Public Member Functions

static HTTPRequestCreateWebsocketRequest (const char *uri, const char *host, const char *protocolName, const char *origin)
 Build a client-side WebSocket upgrade request (RFC 6455 handshake).

Public Attributes

uint8 type
 HTTP_* method id.
uint64 time
 Timestamp when reception/creation started (ms epoch).
uint64 endReceiveTime
 Timestamp when the request was fully received (ms epoch).
uint64 source
 Packed uint64 endpoint of the sender (0 if local).
uint32 headerLength
 Length of the header block in ::data, in bytes.
uint32 contentLength
 Body length (from Content-Length / parsing), in bytes.
uint64 ifModifiedSince
 Parsed If-Modified-Since timestamp (ms epoch; 0 = absent).
bool keepAlive
 Whether the connection should be kept open after replying.
char * data
 Owned raw request bytes (header followed by body).
std::map< std::string, std::string > entries
 Parsed header fields (name to value).
std::map< std::string, std::string > params
 URI query and form parameters (name to value).
std::map< std::string, HTTPPostEntry * > postEntries
 Multipart POST parts by name (owned).
std::string postBoundary
 Multipart boundary string, when applicable.

Detailed Description

A parsed or generated HTTP request (also used for WebSocket upgrade handshakes).

Dual-role container: on the server side it is filled incrementally from socket bytes via processHeader() + processContent(); on the client side it is built with one of the createRequest() overloads and serialised from the ::data buffer. Header fields land in ::entries, URI/query and form parameters in ::params, and multipart POST parts in ::postEntries. The whole raw request (header + body) lives in the owned ::data buffer.

Note
Not thread-safe; a request object belongs to one connection thread.

Definition at line 172 of file NetworkProtocols.h.

Constructor & Destructor Documentation

◆ HTTPRequest() [1/2]

cmlabs::HTTPRequest::HTTPRequest ( uint64 source = 0,
uint64 startRecTime = 0 )

Construct an empty request.

Parameters
sourcePacked uint64 endpoint of the sender (0 if local).
startRecTimeReceive start timestamp; defaults to now when 0.

Definition at line 42 of file NetworkProtocols.cpp.

References contentLength, data, endReceiveTime, cmlabs::GetTimeNow(), headerLength, ifModifiedSince, keepAlive, source, time, and type.

Referenced by CreateWebsocketRequest(), and HTTPRequest().

◆ HTTPRequest() [2/2]

cmlabs::HTTPRequest::HTTPRequest ( HTTPRequest * req)

Deep-copy constructor.

Parameters
reqRequest to copy (not modified).

Definition at line 57 of file NetworkProtocols.cpp.

References contentLength, data, endReceiveTime, entries, headerLength, HTTPRequest(), ifModifiedSince, keepAlive, params, source, time, and type.

◆ ~HTTPRequest()

cmlabs::HTTPRequest::~HTTPRequest ( )
virtual

Definition at line 73 of file NetworkProtocols.cpp.

References data, and postEntries.

Member Function Documentation

◆ convertToMessage()

DataMessage * cmlabs::HTTPRequest::convertToMessage ( )

Convert this HTTP request into a binary DataMessage (URI, params and content mapped to message fields) for handing into message-based systems.

Returns
A new DataMessage owned by the caller, or NULL.

Definition at line 497 of file NetworkProtocols.cpp.

References endReceiveTime, entries, getRequest(), getURI(), params, postEntries, cmlabs::DataMessage::setCreatedTime(), cmlabs::DataMessage::setData(), cmlabs::DataMessage::setInt(), cmlabs::DataMessage::setRecvTime(), cmlabs::DataMessage::setString(), cmlabs::DataMessage::setTime(), source, cmlabs::utils::stristr(), time, and type.

Referenced by cmlabs::RequestGateway::callExternalAPI().

◆ createMultipartRequest()

bool cmlabs::HTTPRequest::createMultipartRequest ( uint8 type,
const char * host,
const char * uri,
std::map< std::string, std::string > & headerEntries,
std::map< std::string, HTTPPostEntry * > & bodyEntries,
bool keepAlive,
uint64 ifModifiedSince )

Build a multipart/form-data request from several named parts.

Parameters
typeHTTP_* method id (typically HTTP_POST).
hostHost header.
uriRequest path.
headerEntriesExtra header name/value pairs.
bodyEntriesNamed body parts (not owned; content copied).
keepAlivePersistent connection flag.
ifModifiedSincems epoch or 0.
Returns
true on success.

Definition at line 733 of file NetworkProtocols.cpp.

References contentLength, data, cmlabs::GetHTTPTime(), headerLength, cmlabs::HTTP_Type, ifModifiedSince, cmlabs::html::IsMimeBinary(), keepAlive, cmlabs::utils::RandomInt(), stricmp, cmlabs::utils::StringFormat(), TIME_YEAR_1970, and type.

Referenced by cmlabs::RESTHTTPCall::generateHTTPRequest(), and cmlabs::NetworkManager::makeHTTPRequest().

◆ createRequest() [1/4]

bool cmlabs::HTTPRequest::createRequest ( uint8 type,
const char * host,
const char * uri,
const char * content,
uint32 contentSize,
bool keepAlive,
uint64 ifModifiedSince )

Build a simple request with optional raw body.

Parameters
typeHTTP_* method id.
hostHost header value.
uriRequest path.
contentOptional body (copied).
contentSizeBody size.
keepAliveRequest a persistent connection when true.
ifModifiedSinceIf-Modified-Since timestamp (ms epoch; 0 = omit).
Returns
true when the raw request was assembled into ::data.

Definition at line 582 of file NetworkProtocols.cpp.

References contentLength, data, cmlabs::GetHTTPTime(), headerLength, cmlabs::HTTP_Type, ifModifiedSince, keepAlive, TIME_YEAR_1970, and type.

Referenced by createRequest(), createRequest(), cmlabs::HTTPServerTest(), cmlabs::NetworkManager::makeHTTPRequest(), cmlabs::NetworkManager::makeHTTPRequest(), cmlabs::NetworkManager::makeHTTPRequest(), cmlabs::NetworkProtocols_UnitTest(), cmlabs::TestWebRequestClient::run(), and cmlabs::NetworkManager::UnitTestHTTP().

◆ createRequest() [2/4]

bool cmlabs::HTTPRequest::createRequest ( uint8 type,
const char * host,
const char * uri,
std::map< std::string, std::string > & headerEntries,
bool keepAlive,
uint64 ifModifiedSince )

Build a request with custom header fields and no body.

Parameters
typeHTTP_* method id.
hostHost header.
uriRequest path.
headerEntriesExtra header name/value pairs.
keepAlivePersistent connection flag.
ifModifiedSincems epoch or 0.
Returns
true on success.

Definition at line 627 of file NetworkProtocols.cpp.

References data, cmlabs::GetHTTPTime(), headerLength, cmlabs::HTTP_Type, ifModifiedSince, keepAlive, stricmp, cmlabs::utils::StringFormat(), TIME_YEAR_1970, and type.

◆ createRequest() [3/4]

bool cmlabs::HTTPRequest::createRequest ( uint8 type,
const char * host,
const char * uri,
std::map< std::string, std::string > & headerEntries,
const char * content,
const char * contentType,
uint32 contentSize,
bool keepAlive,
uint64 ifModifiedSince )

Build a request with custom headers and a typed raw body.

Parameters
typeHTTP_* method id.
hostHost header.
uriRequest path.
headerEntriesExtra header name/value pairs.
contentBody bytes (copied).
contentTypeMIME type of the body.
contentSizeBody size.
keepAlivePersistent connection flag.
ifModifiedSincems epoch or 0.
Returns
true on success.

Definition at line 678 of file NetworkProtocols.cpp.

References contentLength, createRequest(), data, cmlabs::GetHTTPTime(), headerLength, cmlabs::HTTP_Type, ifModifiedSince, keepAlive, stricmp, cmlabs::utils::StringFormat(), TIME_YEAR_1970, and type.

◆ createRequest() [4/4]

bool cmlabs::HTTPRequest::createRequest ( uint8 type,
const char * host,
const char * uri,
std::map< std::string, std::string > & headerEntries,
HTTPPostEntry * bodyEntry,
bool keepAlive,
uint64 ifModifiedSince )

Build a request whose body is a single form entry.

Parameters
typeHTTP_* method id.
hostHost header.
uriRequest path.
headerEntriesExtra header name/value pairs.
bodyEntryThe single body part (not owned; content copied).
keepAlivePersistent connection flag.
ifModifiedSincems epoch or 0.
Returns
true on success.

Definition at line 671 of file NetworkProtocols.cpp.

References cmlabs::HTTPPostEntry::content, cmlabs::HTTPPostEntry::contentSize, createRequest(), ifModifiedSince, keepAlive, cmlabs::HTTPPostEntry::type, and type.

◆ CreateWebsocketRequest()

HTTPRequest * cmlabs::HTTPRequest::CreateWebsocketRequest ( const char * uri,
const char * host,
const char * protocolName,
const char * origin )
static

Build a client-side WebSocket upgrade request (RFC 6455 handshake).

Parameters
uriRequest path.
hostHost header value.
protocolNameOptional Sec-WebSocket-Protocol value.
originOptional Origin header value.
Returns
A new request owned by the caller, or NULL on failure.

Definition at line 32 of file NetworkProtocols.cpp.

References createWebsocketRequest(), and HTTPRequest().

Referenced by cmlabs::NetworkChannel::createWebsocketConnection().

◆ createWebsocketRequest()

bool cmlabs::HTTPRequest::createWebsocketRequest ( const char * uri,
const char * host,
const char * protocolName,
const char * origin )

Fill this object with a WebSocket upgrade handshake request.

Parameters
uriRequest path.
hostHost header.
protocolNameOptional Sec-WebSocket-Protocol.
originOptional Origin.
Returns
true on success.

Definition at line 857 of file NetworkProtocols.cpp.

References base64_encode(), contentLength, data, headerLength, cmlabs::utils::RandomInt(), cmlabs::utils::StringFormat(), and cmlabs::utils::TextStartsWith().

Referenced by CreateWebsocketRequest(), and cmlabs::NetworkManager::WebsocketTest().

◆ decodeBasicAuthorization()

std::string cmlabs::HTTPRequest::decodeBasicAuthorization ( )

Decode the Basic Authorization header.

Returns
"user:password" plaintext, or empty.

Definition at line 276 of file NetworkProtocols.cpp.

References base64_decode(), and getBasicAuthorization().

Referenced by getBasicAuthorizationPassword(), and getBasicAuthorizationUser().

◆ getBasicAuthorization()

const char * cmlabs::HTTPRequest::getBasicAuthorization ( )
Returns
The raw base64 Basic Authorization credential, or NULL if absent.

Definition at line 269 of file NetworkProtocols.cpp.

References getHeaderEntry(), and cmlabs::utils::TextStartsWith().

Referenced by cmlabs::RequestGateway::callInternalAPI(), and decodeBasicAuthorization().

◆ getBasicAuthorizationPassword()

std::string cmlabs::HTTPRequest::getBasicAuthorizationPassword ( )
Returns
The password from the Basic Authorization header, or empty.

Definition at line 292 of file NetworkProtocols.cpp.

References decodeBasicAuthorization(), and cmlabs::utils::TextListSplit().

◆ getBasicAuthorizationUser()

std::string cmlabs::HTTPRequest::getBasicAuthorizationUser ( )
Returns
The username from the Basic Authorization header, or empty.

Definition at line 285 of file NetworkProtocols.cpp.

References decodeBasicAuthorization(), and cmlabs::utils::TextListSplit().

◆ getContent()

const char * cmlabs::HTTPRequest::getContent ( uint32 & size)

Get the (decoded) request body.

Parameters
sizeOut: body size in bytes.
Returns
Body bytes, or NULL. Owned by this object.

Definition at line 239 of file NetworkProtocols.cpp.

References contentLength, data, and headerLength.

Referenced by cmlabs::NetworkProtocols_UnitTest().

◆ getHeaderEntry()

const char * cmlabs::HTTPRequest::getHeaderEntry ( const char * entry)

Look up a header field (case-insensitive).

Parameters
entryHeader name, e.g. "Content-Type".
Returns
The value, or NULL if absent. Pointer valid while this object lives.

Definition at line 249 of file NetworkProtocols.cpp.

References entries.

Referenced by cmlabs::RequestGateway::callInternalAPI(), cmlabs::RESTParser::extractParameters(), getBasicAuthorization(), getProtocol(), getRequest(), getURI(), cmlabs::NetworkChannel::HTTPServerRun(), isWebsocketUpgrade(), cmlabs::RESTParser::parseRequest(), and cmlabs::RequestGateway::receiveHTTPRequest().

◆ getParameter()

const char * cmlabs::HTTPRequest::getParameter ( const char * entry)

Look up a URI query or form parameter by name.

Parameters
entryParameter name.
Returns
The value, or NULL if absent.

Definition at line 549 of file NetworkProtocols.cpp.

References params.

Referenced by cmlabs::RequestGateway::callExternalAPI(), cmlabs::RequestGateway::callInternalAPI(), and cmlabs::NetworkProtocols_UnitTest().

◆ getPostData() [1/2]

const char * cmlabs::HTTPRequest::getPostData ( const char * entry,
uint32 & size )

Get a multipart POST part's content and size.

Parameters
entryPart name.
sizeOut: content size.
Returns
Content bytes, or NULL. Owned by this object.

Definition at line 566 of file NetworkProtocols.cpp.

References postEntries.

◆ getPostData() [2/2]

const char * cmlabs::HTTPRequest::getPostData ( const char * entry,
uint32 & size,
const char ** type )

Get a multipart POST part's content, size and MIME type.

Parameters
entryPart name.
sizeOut: content size.
typeOut: MIME type pointer.
Returns
Content bytes, or NULL if the part does not exist. Owned by this object.

Definition at line 557 of file NetworkProtocols.cpp.

References postEntries, and type.

Referenced by cmlabs::RESTParser::extractArrayParameters(), cmlabs::RESTParser::extractParameters(), and cmlabs::RESTParser::setParameterValue().

◆ getPostDataType()

const char * cmlabs::HTTPRequest::getPostDataType ( const char * entry)
Parameters
entryPart name.
Returns
The MIME type of a multipart POST part, or NULL.

Definition at line 574 of file NetworkProtocols.cpp.

References postEntries.

Referenced by cmlabs::RESTParser::extractArrayParameters(), cmlabs::RESTParser::extractParameters(), and cmlabs::RESTParser::setParameterValue().

◆ getProtocol()

const char * cmlabs::HTTPRequest::getProtocol ( )
Returns
The protocol/version string (e.g. "HTTP/1.1"), or NULL.

Definition at line 265 of file NetworkProtocols.cpp.

References getHeaderEntry().

◆ getRawContent()

const char * cmlabs::HTTPRequest::getRawContent ( uint32 & size)

Get the raw, untransformed body bytes as received.

Parameters
sizeOut: body size in bytes.
Returns
Body bytes, or NULL. Owned by this object.

Definition at line 244 of file NetworkProtocols.cpp.

References contentLength, data, and headerLength.

Referenced by cmlabs::NetworkProtocols_UnitTest().

◆ getRequest()

const char * cmlabs::HTTPRequest::getRequest ( )
Returns
The request line method string (e.g. "GET"), or NULL.

Definition at line 257 of file NetworkProtocols.cpp.

References getHeaderEntry().

Referenced by convertToMessage(), and cmlabs::NetworkProtocols_UnitTest().

◆ getSize()

uint32 cmlabs::HTTPRequest::getSize ( )
Returns
Total size of the serialised request (header + body) in bytes.

Definition at line 917 of file NetworkProtocols.cpp.

References contentLength, data, and headerLength.

Referenced by cmlabs::RequestGateway::callInternalAPI(), cmlabs::RequestGateway::receiveHTTPRequest(), and cmlabs::HTTPProtocol::SendHTTPRequest().

◆ getURI()

const char * cmlabs::HTTPRequest::getURI ( )
Returns
The request URI path (without query parameters), or NULL.

Definition at line 261 of file NetworkProtocols.cpp.

References getHeaderEntry().

Referenced by convertToMessage(), cmlabs::NetworkProtocols_UnitTest(), cmlabs::RESTParser::parseRequest(), and cmlabs::RequestGateway::receiveHTTPRequest().

◆ isWebsocketUpgrade()

bool cmlabs::HTTPRequest::isWebsocketUpgrade ( )
Returns
true when this request is a WebSocket upgrade handshake (Connection: Upgrade + Upgrade: websocket headers present).

Definition at line 535 of file NetworkProtocols.cpp.

References getHeaderEntry(), and stricmp.

Referenced by cmlabs::NetworkChannel::HTTPServerRun().

◆ parseContentChunk()

bool cmlabs::HTTPRequest::parseContentChunk ( const char * chunk,
uint32 size )

Parse one chunk of a multipart body (between boundaries) into ::postEntries.

Parameters
chunkChunk bytes.
sizeByte count.
Returns
true on success.

Definition at line 373 of file NetworkProtocols.cpp.

References cmlabs::HTTPPostEntry::filename, cmlabs::HTTPPostEntry::isValid(), cmlabs::HTTPPostEntry::name, postEntries, cmlabs::HTTPPostEntry::setContent(), cmlabs::utils::TextListSplit(), cmlabs::utils::TextMultiMapSplit(), cmlabs::utils::TextStartsWith(), cmlabs::utils::TextTrimQuotes(), and cmlabs::HTTPPostEntry::type.

Referenced by parseContentParameters().

◆ parseContentParameters()

bool cmlabs::HTTPRequest::parseContentParameters ( const char * content,
uint32 size )

Parse a URL-encoded form body into ::params.

Parameters
contentBody bytes.
sizeByte count.
Returns
true on success.

Definition at line 319 of file NetworkProtocols.cpp.

References entries, cmlabs::HTTPPostEntry::name, parseContentChunk(), postBoundary, postEntries, cmlabs::HTTPPostEntry::setContent(), and cmlabs::HTTPPostEntry::type.

Referenced by processContent().

◆ parseURIParameters()

bool cmlabs::HTTPRequest::parseURIParameters ( const char * text)

Parse "a=1&b=2" style parameters from a URI query string into ::params.

Parameters
textQuery text after '?'.
Returns
true on success.

Definition at line 454 of file NetworkProtocols.cpp.

References cmlabs::html::DecodeHTML(), params, and cmlabs::utils::TextMultiMapSplit().

Referenced by processHeader().

◆ processContent()

bool cmlabs::HTTPRequest::processContent ( const char * buffer,
uint32 size )

Append body bytes after the header has been parsed.

Parameters
bufferBody bytes.
sizeByte count.
Returns
true when the body is complete (Content-Length reached).

Definition at line 229 of file NetworkProtocols.cpp.

References contentLength, data, endReceiveTime, cmlabs::GetTimeNow(), headerLength, and parseContentParameters().

Referenced by cmlabs::NetworkProtocols_UnitTest(), and cmlabs::HTTPProtocol::ReceiveHTTPRequest().

◆ processHeader()

bool cmlabs::HTTPRequest::processHeader ( const char * buffer,
uint32 size,
bool & isInvalid )

Parse the HTTP header block from raw bytes.

Parameters
bufferRaw bytes from the socket (must contain the full header up to CRLFCRLF).
sizeNumber of bytes at buffer.
isInvalidOut: set true when the bytes are definitely not valid HTTP.
Returns
true when the header was fully parsed; false when more data is needed or invalid.

Definition at line 86 of file NetworkProtocols.cpp.

References contentLength, data, endReceiveTime, entries, cmlabs::utils::GetNextLineEnd(), cmlabs::GetTimeFromString(), cmlabs::GetTimeNow(), headerLength, HTTP_DELETE, HTTP_GET, HTTP_HEAD, HTTP_OPTIONS, HTTP_POST, HTTP_PUT, ifModifiedSince, keepAlive, parseURIParameters(), postBoundary, stricmp, cmlabs::utils::StringFormat(), cmlabs::utils::stristr(), cmlabs::utils::TextMultiMapSplit(), and type.

Referenced by cmlabs::NetworkProtocols_UnitTest(), cmlabs::HTTPProtocol::ReceiveHTTPRequest(), and cmlabs::RESTParser::UnitTest().

◆ setBasicAuthorization() [1/2]

bool cmlabs::HTTPRequest::setBasicAuthorization ( const char * authB64)

Set the Authorization header from a pre-encoded base64 credential.

Parameters
authB64base64("user:password").
Returns
true on success.

Definition at line 299 of file NetworkProtocols.cpp.

References entries.

◆ setBasicAuthorization() [2/2]

bool cmlabs::HTTPRequest::setBasicAuthorization ( const char * user,
const char * password )

Set the Authorization header from plaintext credentials (encoded internally).

Parameters
userUsername.
passwordPassword.
Returns
true on success.

Definition at line 310 of file NetworkProtocols.cpp.

References base64_encode(), entries, and cmlabs::utils::StringFormat().

Member Data Documentation

◆ contentLength

◆ data

◆ endReceiveTime

uint64 cmlabs::HTTPRequest::endReceiveTime

Timestamp when the request was fully received (ms epoch).

Definition at line 310 of file NetworkProtocols.h.

Referenced by cmlabs::RequestGateway::callInternalAPI(), convertToMessage(), HTTPRequest(), HTTPRequest(), processContent(), processHeader(), and cmlabs::RequestGateway::receiveHTTPRequest().

◆ entries

std::map<std::string, std::string> cmlabs::HTTPRequest::entries

◆ headerLength

◆ ifModifiedSince

uint64 cmlabs::HTTPRequest::ifModifiedSince

◆ keepAlive

bool cmlabs::HTTPRequest::keepAlive

Whether the connection should be kept open after replying.

Definition at line 315 of file NetworkProtocols.h.

Referenced by createMultipartRequest(), createRequest(), createRequest(), createRequest(), createRequest(), HTTPRequest(), HTTPRequest(), and processHeader().

◆ params

std::map<std::string, std::string> cmlabs::HTTPRequest::params

URI query and form parameters (name to value).

Definition at line 319 of file NetworkProtocols.h.

Referenced by convertToMessage(), getParameter(), HTTPRequest(), and parseURIParameters().

◆ postBoundary

std::string cmlabs::HTTPRequest::postBoundary

Multipart boundary string, when applicable.

Definition at line 321 of file NetworkProtocols.h.

Referenced by parseContentParameters(), and processHeader().

◆ postEntries

std::map<std::string, HTTPPostEntry*> cmlabs::HTTPRequest::postEntries

Multipart POST parts by name (owned).

Definition at line 320 of file NetworkProtocols.h.

Referenced by convertToMessage(), getPostData(), getPostData(), getPostDataType(), parseContentChunk(), parseContentParameters(), and ~HTTPRequest().

◆ source

uint64 cmlabs::HTTPRequest::source

◆ time

uint64 cmlabs::HTTPRequest::time

Timestamp when reception/creation started (ms epoch).

Definition at line 309 of file NetworkProtocols.h.

Referenced by convertToMessage(), HTTPRequest(), and HTTPRequest().

◆ type


The documentation for this class was generated from the following files: