Improvements to HTTP::Parser - now builds responses and requests by reference and has getUrl() method to get the URL without URI-parameters.

This commit is contained in:
Thulinma 2012-08-31 16:53:46 +02:00
parent 4a940f7514
commit c6bb67c4b9
2 changed files with 24 additions and 14 deletions

View file

@ -16,13 +16,14 @@ namespace HTTP{
bool Read(std::string & strbuf);
std::string GetHeader(std::string i);
std::string GetVar(std::string i);
std::string getUrl();
void SetHeader(std::string i, std::string v);
void SetHeader(std::string i, int v);
void SetVar(std::string i, std::string v);
void SetBody(std::string s);
void SetBody(char * buffer, int len);
std::string BuildRequest();
std::string BuildResponse(std::string code, std::string message);
std::string & BuildRequest();
std::string & BuildResponse(std::string code, std::string message);
void Chunkify(std::string & bodypart);
void Clean();
static std::string urlunescape(const std::string & in);
@ -37,6 +38,7 @@ namespace HTTP{
bool seenReq;
bool parse(std::string & HTTPbuffer);
void parseVars(std::string data);
std::string builder;
std::string read_buffer;
std::map<std::string, std::string> headers;
std::map<std::string, std::string> vars;