Web framework C++  2.0.0
Simple web framework on c++ designed to easily create web pages, etc
Static Public Member Functions | List of all members
ParserHTTP Class Reference

static class for parsing, encoding, decoding any http data More...

#include <parser_http.h>

Collaboration diagram for ParserHTTP:
Collaboration graph

Static Public Member Functions

static RequestgetRequestFromStr (std::string &str)
 
static std::string getStrFromResponse (Response &response)
 
static std::string urlEncode (const std::string &value)
 
static std::string urlDecode (const std::string &value)
 
static std::string getTime (const time_t *time_struct=nullptr, const char *format="%Y.%m.%d")
 
static std::string trim (std::string &str)
 
static std::string sha256 (std::string &key, std::string &message)
 
static std::string base64Encode (std::string &value)
 
static std::string base64Decode (std::string &value)
 

Detailed Description

static class for parsing, encoding, decoding any http data

ParserHTTP is used to serialize and deserialize http request, response etc.

Member Function Documentation

static std::string ParserHTTP::base64Decode ( std::string &  value)
static
Parameters
value
Returns
static std::string ParserHTTP::base64Encode ( std::string &  value)
static
Parameters
value
Returns
static Request* ParserHTTP::getRequestFromStr ( std::string &  str)
static

Deserialize http request from input string

Parameters
strinput string
Returns
deserialized Request object
static std::string ParserHTTP::getStrFromResponse ( Response response)
static

Serialize http response into string

Parameters
responseResponse object
Returns
serialized string
static std::string ParserHTTP::getTime ( const time_t *  time_struct = nullptr,
const char *  format = "%Y.%m.%d" 
)
static

get date stamp in string in format from time_t

Parameters
time_structrequired time in time_t, if nullptr - execute current time
formatformat of representing date in string
Returns
date stamp as string
static std::string ParserHTTP::sha256 ( std::string &  key,
std::string &  message 
)
static
Parameters
key
message
Returns
static std::string ParserHTTP::trim ( std::string &  str)
static
Parameters
str
Returns
static std::string ParserHTTP::urlDecode ( const std::string &  value)
static

Decode input string

Parameters
valueinput string
Returns
decoded string
static std::string ParserHTTP::urlEncode ( const std::string &  value)
static

Encode input string

Parameters
valueinput string
Returns
encoded string

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