tgbot-cpp
Loading...
Searching...
No Matches
HttpReqArg.h
Go to the documentation of this file.
1#ifndef TGBOT_HTTPPARAMETER_H
2#define TGBOT_HTTPPARAMETER_H
3
4#include "tgbot/export.h"
5
6#include <boost/lexical_cast.hpp>
7
8#include <string>
9#include <vector>
10#include <functional>
11
12namespace TgBot {
13
19class TGBOT_API HttpReqArg {
20
21public:
22 template<typename T>
23 HttpReqArg(std::string name, const T& value, bool isFile = false, std::string mimeType = "text/plain", std::string fileName = "") :
24 name(std::move(name)), value(boost::lexical_cast<std::string>(value)), isFile(isFile), mimeType(std::move(mimeType)), fileName(std::move(fileName))
25 {
26 }
27
31 std::string name;
32
36 std::string value;
37
41 bool isFile = false;
42
46 std::string mimeType = "text/plain";
47
51 std::string fileName;
52};
53
54}
55
56
57#endif //TGBOT_HTTPPARAMETER_H
This class represents argument in POST http requests.
Definition HttpReqArg.h:19
std::string name
Name of an argument.
Definition HttpReqArg.h:31
HttpReqArg(std::string name, const T &value, bool isFile=false, std::string mimeType="text/plain", std::string fileName="")
Definition HttpReqArg.h:23
std::string value
Value of an argument.
Definition HttpReqArg.h:36
std::string fileName
Should be set if an argument value hold some file contents.
Definition HttpReqArg.h:51
Definition Api.h:39