tgbot-cpp
Loading...
Searching...
No Matches
HttpParser.h
Go to the documentation of this file.
1#ifndef TGBOT_HTTPPARSER_H
2#define TGBOT_HTTPPARSER_H
3
4#include "tgbot/net/Url.h"
6
7#include <string>
8#include <unordered_map>
9#include <vector>
10
11namespace TgBot {
12
13class TGBOT_API HttpParser {
14
15public:
16 std::string generateRequest(const Url& url, const std::vector<HttpReqArg>& args, bool isKeepAlive = false) const;
17 std::string generateMultipartFormData(const std::vector<HttpReqArg>& args, const std::string& boundary) const;
18 std::string generateMultipartBoundary(const std::vector<HttpReqArg>& args) const;
19 std::string generateWwwFormUrlencoded(const std::vector<HttpReqArg>& args) const;
20 std::string generateResponse(const std::string& data, const std::string& mimeType, unsigned short statusCode, const std::string& statusStr, bool isKeepAlive) const;
21 std::unordered_map<std::string, std::string> parseHeader(const std::string& data, bool isRequest) const;
22 std::string extractBody(const std::string& data) const;
23};
24
25}
26
27#endif //TGBOT_HTTPPARSER_H
std::unordered_map< std::string, std::string > parseHeader(const std::string &data, bool isRequest) const
std::string generateRequest(const Url &url, const std::vector< HttpReqArg > &args, bool isKeepAlive=false) const
std::string generateMultipartFormData(const std::vector< HttpReqArg > &args, const std::string &boundary) const
std::string generateMultipartBoundary(const std::vector< HttpReqArg > &args) const
std::string generateResponse(const std::string &data, const std::string &mimeType, unsigned short statusCode, const std::string &statusStr, bool isKeepAlive) const
std::string extractBody(const std::string &data) const
std::string generateWwwFormUrlencoded(const std::vector< HttpReqArg > &args) const
This class parses a string with the url.
Definition Url.h:15
Definition Api.h:40