A basic class to parse a HTTP message, both request and response. More...
#include "http.h"
Public Member Functions | |
void | Parse (HTTPMessage *httpMessage, const std::string &buffer) |
Parse a std::string to a HTTP message. More... | |
void | Parse (HTTPMessage *httpMessage, const std::vector< uint8_t > &buffer) |
Parse a binary vector to an HTTP message. More... | |
void | stripUnicode (std::string &str) |
Static Public Member Functions | |
static bool | invalidChar (char c) |
A basic class to parse a HTTP message, both request and response.
Allows for either string data to be passed in, or for a vector of unsigned 8-bit integers to be passed in.
Requires that a whole message be sent in for parsing.
|
inlinestatic |
Definition at line 1183 of file http.h.
Referenced by stripUnicode().
|
inline |
Parse a std::string to a HTTP message.
Pass in a pointer to an HTTPMessage which is then written to for headers and other message data.
note: this must be a complete HTTP message
Definition at line 951 of file http.h.
References stripUnicode().
|
inline |
Parse a binary vector to an HTTP message.
Pass in a pointer to an HTTPMessage which is written to for headers and other message data.
note: shrink the vector buffer before passing it in with shrink_to_fit
otherwise empty characters will show up for the body note: must be a complete HTTP message.
Definition at line 969 of file http.h.
References ns3::HTTPMessage::GetContentLength(), ns3::HTTPMessage::GetMessageBody(), ns3::HTTPMessage::GetStatusCode(), ns3::HEADER_KEY, ns3::HEADER_VALUE, ns3::HTTPVersion1, ns3::HTTPVersion11, ns3::PARSING_BODY, ns3::PARSING_START_LINE, ns3::HTTPMessage::SetFragmented(), ns3::HTTPMessage::SetHeader(), ns3::HTTPMessage::SetMethod(), ns3::HTTPMessage::SetPath(), ns3::HTTPMessage::SetStatusCode(), ns3::HTTPMessage::SetStatusMessage(), ns3::HTTPMessage::SetVersion(), ns3::START_LINE_REQUEST, and ns3::START_LINE_RESPONSE.
|
inline |
Definition at line 1187 of file http.h.
References invalidChar().
Referenced by Parse().