|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
A parsed or generated HTTP request (also used for WebSocket upgrade handshakes). More...
#include <NetworkProtocols.h>
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. | |
| DataMessage * | convertToMessage () |
| 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 HTTPRequest * | CreateWebsocketRequest (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. | |
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.
Definition at line 172 of file NetworkProtocols.h.
| cmlabs::HTTPRequest::HTTPRequest | ( | uint64 | source = 0, |
| uint64 | startRecTime = 0 ) |
Construct an empty request.
| source | Packed uint64 endpoint of the sender (0 if local). |
| startRecTime | Receive 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().
| cmlabs::HTTPRequest::HTTPRequest | ( | HTTPRequest * | req | ) |
Deep-copy constructor.
| req | Request 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.
|
virtual |
Definition at line 73 of file NetworkProtocols.cpp.
References data, and postEntries.
| 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.
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().
| 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.
| type | HTTP_* method id (typically HTTP_POST). |
| host | Host header. |
| uri | Request path. |
| headerEntries | Extra header name/value pairs. |
| bodyEntries | Named body parts (not owned; content copied). |
| keepAlive | Persistent connection flag. |
| ifModifiedSince | ms epoch or 0. |
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().
| 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.
| type | HTTP_* method id. |
| host | Host header value. |
| uri | Request path. |
| content | Optional body (copied). |
| contentSize | Body size. |
| keepAlive | Request a persistent connection when true. |
| ifModifiedSince | If-Modified-Since timestamp (ms epoch; 0 = omit). |
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().
| 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.
| type | HTTP_* method id. |
| host | Host header. |
| uri | Request path. |
| headerEntries | Extra header name/value pairs. |
| keepAlive | Persistent connection flag. |
| ifModifiedSince | ms epoch or 0. |
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.
| 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.
| type | HTTP_* method id. |
| host | Host header. |
| uri | Request path. |
| headerEntries | Extra header name/value pairs. |
| content | Body bytes (copied). |
| contentType | MIME type of the body. |
| contentSize | Body size. |
| keepAlive | Persistent connection flag. |
| ifModifiedSince | ms epoch or 0. |
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.
| 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.
| type | HTTP_* method id. |
| host | Host header. |
| uri | Request path. |
| headerEntries | Extra header name/value pairs. |
| bodyEntry | The single body part (not owned; content copied). |
| keepAlive | Persistent connection flag. |
| ifModifiedSince | ms epoch or 0. |
Definition at line 671 of file NetworkProtocols.cpp.
References cmlabs::HTTPPostEntry::content, cmlabs::HTTPPostEntry::contentSize, createRequest(), ifModifiedSince, keepAlive, cmlabs::HTTPPostEntry::type, and type.
|
static |
Build a client-side WebSocket upgrade request (RFC 6455 handshake).
| uri | Request path. |
| host | Host header value. |
| protocolName | Optional Sec-WebSocket-Protocol value. |
| origin | Optional Origin header value. |
Definition at line 32 of file NetworkProtocols.cpp.
References createWebsocketRequest(), and HTTPRequest().
Referenced by cmlabs::NetworkChannel::createWebsocketConnection().
| 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.
| uri | Request path. |
| host | Host header. |
| protocolName | Optional Sec-WebSocket-Protocol. |
| origin | Optional Origin. |
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().
| std::string cmlabs::HTTPRequest::decodeBasicAuthorization | ( | ) |
Decode the Basic Authorization header.
Definition at line 276 of file NetworkProtocols.cpp.
References base64_decode(), and getBasicAuthorization().
Referenced by getBasicAuthorizationPassword(), and getBasicAuthorizationUser().
| const char * cmlabs::HTTPRequest::getBasicAuthorization | ( | ) |
Definition at line 269 of file NetworkProtocols.cpp.
References getHeaderEntry(), and cmlabs::utils::TextStartsWith().
Referenced by cmlabs::RequestGateway::callInternalAPI(), and decodeBasicAuthorization().
| std::string cmlabs::HTTPRequest::getBasicAuthorizationPassword | ( | ) |
Definition at line 292 of file NetworkProtocols.cpp.
References decodeBasicAuthorization(), and cmlabs::utils::TextListSplit().
| std::string cmlabs::HTTPRequest::getBasicAuthorizationUser | ( | ) |
Definition at line 285 of file NetworkProtocols.cpp.
References decodeBasicAuthorization(), and cmlabs::utils::TextListSplit().
| const char * cmlabs::HTTPRequest::getContent | ( | uint32 & | size | ) |
Get the (decoded) request body.
| size | Out: body size in bytes. |
Definition at line 239 of file NetworkProtocols.cpp.
References contentLength, data, and headerLength.
Referenced by cmlabs::NetworkProtocols_UnitTest().
| const char * cmlabs::HTTPRequest::getHeaderEntry | ( | const char * | entry | ) |
Look up a header field (case-insensitive).
| entry | Header name, e.g. "Content-Type". |
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().
| const char * cmlabs::HTTPRequest::getParameter | ( | const char * | entry | ) |
Look up a URI query or form parameter by name.
| entry | Parameter name. |
Definition at line 549 of file NetworkProtocols.cpp.
References params.
Referenced by cmlabs::RequestGateway::callExternalAPI(), cmlabs::RequestGateway::callInternalAPI(), and cmlabs::NetworkProtocols_UnitTest().
| const char * cmlabs::HTTPRequest::getPostData | ( | const char * | entry, |
| uint32 & | size ) |
Get a multipart POST part's content and size.
| entry | Part name. |
| size | Out: content size. |
Definition at line 566 of file NetworkProtocols.cpp.
References postEntries.
| const char * cmlabs::HTTPRequest::getPostData | ( | const char * | entry, |
| uint32 & | size, | ||
| const char ** | type ) |
Get a multipart POST part's content, size and MIME type.
| entry | Part name. |
| size | Out: content size. |
| type | Out: MIME type pointer. |
Definition at line 557 of file NetworkProtocols.cpp.
References postEntries, and type.
Referenced by cmlabs::RESTParser::extractArrayParameters(), cmlabs::RESTParser::extractParameters(), and cmlabs::RESTParser::setParameterValue().
| const char * cmlabs::HTTPRequest::getPostDataType | ( | const char * | entry | ) |
| entry | Part name. |
Definition at line 574 of file NetworkProtocols.cpp.
References postEntries.
Referenced by cmlabs::RESTParser::extractArrayParameters(), cmlabs::RESTParser::extractParameters(), and cmlabs::RESTParser::setParameterValue().
| const char * cmlabs::HTTPRequest::getProtocol | ( | ) |
Definition at line 265 of file NetworkProtocols.cpp.
References getHeaderEntry().
| const char * cmlabs::HTTPRequest::getRawContent | ( | uint32 & | size | ) |
Get the raw, untransformed body bytes as received.
| size | Out: body size in bytes. |
Definition at line 244 of file NetworkProtocols.cpp.
References contentLength, data, and headerLength.
Referenced by cmlabs::NetworkProtocols_UnitTest().
| const char * cmlabs::HTTPRequest::getRequest | ( | ) |
Definition at line 257 of file NetworkProtocols.cpp.
References getHeaderEntry().
Referenced by convertToMessage(), and cmlabs::NetworkProtocols_UnitTest().
| uint32 cmlabs::HTTPRequest::getSize | ( | ) |
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().
| const char * cmlabs::HTTPRequest::getURI | ( | ) |
Definition at line 261 of file NetworkProtocols.cpp.
References getHeaderEntry().
Referenced by convertToMessage(), cmlabs::NetworkProtocols_UnitTest(), cmlabs::RESTParser::parseRequest(), and cmlabs::RequestGateway::receiveHTTPRequest().
| bool cmlabs::HTTPRequest::isWebsocketUpgrade | ( | ) |
Definition at line 535 of file NetworkProtocols.cpp.
References getHeaderEntry(), and stricmp.
Referenced by cmlabs::NetworkChannel::HTTPServerRun().
| bool cmlabs::HTTPRequest::parseContentChunk | ( | const char * | chunk, |
| uint32 | size ) |
Parse one chunk of a multipart body (between boundaries) into ::postEntries.
| chunk | Chunk bytes. |
| size | Byte count. |
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().
| bool cmlabs::HTTPRequest::parseContentParameters | ( | const char * | content, |
| uint32 | size ) |
Parse a URL-encoded form body into ::params.
| content | Body bytes. |
| size | Byte count. |
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().
| bool cmlabs::HTTPRequest::parseURIParameters | ( | const char * | text | ) |
Parse "a=1&b=2" style parameters from a URI query string into ::params.
| text | Query text after '?'. |
Definition at line 454 of file NetworkProtocols.cpp.
References cmlabs::html::DecodeHTML(), params, and cmlabs::utils::TextMultiMapSplit().
Referenced by processHeader().
| bool cmlabs::HTTPRequest::processContent | ( | const char * | buffer, |
| uint32 | size ) |
Append body bytes after the header has been parsed.
| buffer | Body bytes. |
| size | Byte count. |
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().
| bool cmlabs::HTTPRequest::processHeader | ( | const char * | buffer, |
| uint32 | size, | ||
| bool & | isInvalid ) |
Parse the HTTP header block from raw bytes.
| buffer | Raw bytes from the socket (must contain the full header up to CRLFCRLF). |
| size | Number of bytes at buffer. |
| isInvalid | Out: set true when the bytes are definitely not valid HTTP. |
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().
| bool cmlabs::HTTPRequest::setBasicAuthorization | ( | const char * | authB64 | ) |
Set the Authorization header from a pre-encoded base64 credential.
| authB64 | base64("user:password"). |
Definition at line 299 of file NetworkProtocols.cpp.
References entries.
| bool cmlabs::HTTPRequest::setBasicAuthorization | ( | const char * | user, |
| const char * | password ) |
Set the Authorization header from plaintext credentials (encoded internally).
| user | Username. |
| password | Password. |
Definition at line 310 of file NetworkProtocols.cpp.
References base64_encode(), entries, and cmlabs::utils::StringFormat().
| uint32 cmlabs::HTTPRequest::contentLength |
Body length (from Content-Length / parsing), in bytes.
Definition at line 313 of file NetworkProtocols.h.
Referenced by cmlabs::RequestGateway::callInternalAPI(), createMultipartRequest(), createRequest(), createRequest(), createWebsocketRequest(), getContent(), getRawContent(), getSize(), HTTPRequest(), HTTPRequest(), cmlabs::NetworkChannel::HTTPServerRun(), cmlabs::NetworkProtocols_UnitTest(), processContent(), processHeader(), and cmlabs::HTTPProtocol::ReceiveHTTPRequest().
| char* cmlabs::HTTPRequest::data |
Owned raw request bytes (header followed by body).
Definition at line 316 of file NetworkProtocols.h.
Referenced by createMultipartRequest(), createRequest(), createRequest(), createRequest(), createWebsocketRequest(), getContent(), getRawContent(), getSize(), HTTPRequest(), HTTPRequest(), processContent(), processHeader(), cmlabs::HTTPProtocol::SendHTTPRequest(), and ~HTTPRequest().
| 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().
| std::map<std::string, std::string> cmlabs::HTTPRequest::entries |
Parsed header fields (name to value).
Definition at line 318 of file NetworkProtocols.h.
Referenced by convertToMessage(), getHeaderEntry(), HTTPRequest(), parseContentParameters(), processHeader(), setBasicAuthorization(), and setBasicAuthorization().
| uint32 cmlabs::HTTPRequest::headerLength |
Length of the header block in ::data, in bytes.
Definition at line 312 of file NetworkProtocols.h.
Referenced by createMultipartRequest(), createRequest(), createRequest(), createRequest(), createWebsocketRequest(), getContent(), getRawContent(), getSize(), HTTPRequest(), HTTPRequest(), cmlabs::NetworkChannel::HTTPServerRun(), cmlabs::NetworkProtocols_UnitTest(), processContent(), processHeader(), and cmlabs::HTTPProtocol::ReceiveHTTPRequest().
| uint64 cmlabs::HTTPRequest::ifModifiedSince |
Parsed If-Modified-Since timestamp (ms epoch; 0 = absent).
Definition at line 314 of file NetworkProtocols.h.
Referenced by cmlabs::RequestGateway::callInternalAPI(), createMultipartRequest(), createRequest(), createRequest(), createRequest(), createRequest(), HTTPRequest(), HTTPRequest(), processHeader(), and cmlabs::RequestGateway::receiveHTTPRequest().
| 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().
| 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().
| std::string cmlabs::HTTPRequest::postBoundary |
Multipart boundary string, when applicable.
Definition at line 321 of file NetworkProtocols.h.
Referenced by parseContentParameters(), and processHeader().
| 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().
| uint64 cmlabs::HTTPRequest::source |
Packed uint64 endpoint of the sender (0 if local).
Definition at line 311 of file NetworkProtocols.h.
Referenced by cmlabs::RequestGateway::callExternalAPI(), cmlabs::RequestGateway::callInternalAPI(), convertToMessage(), HTTPRequest(), HTTPRequest(), and cmlabs::RequestGateway::receiveHTTPRequest().
| 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().
| uint8 cmlabs::HTTPRequest::type |
HTTP_* method id.
Definition at line 308 of file NetworkProtocols.h.
Referenced by cmlabs::RequestGateway::callInternalAPI(), convertToMessage(), createMultipartRequest(), createRequest(), createRequest(), createRequest(), createRequest(), getPostData(), HTTPRequest(), HTTPRequest(), cmlabs::NetworkProtocols_UnitTest(), cmlabs::RESTParser::parseRequest(), processHeader(), cmlabs::RequestGateway::receiveHTTPRequest(), and cmlabs::RESTParser::UnitTest().