mirror of
https://github.com/UltraCoderRU/telebotxx.git
synced 2026-01-28 04:05:13 +00:00
Disabled default 'Expect: 100-Continue' header in POST requests.
This commit is contained in:
parent
1e43989b77
commit
544b2d1512
1 changed files with 10 additions and 4 deletions
|
|
@ -143,13 +143,15 @@ public:
|
||||||
headers.push_back(ss.str());
|
headers.push_back(ss.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
headers.push_back("Expect:");
|
||||||
|
|
||||||
// Set options
|
// Set options
|
||||||
request.setOpt(new curlpp::Options::Url(telegramMainUrl_ + "/sendMessage"));
|
request.setOpt(new curlpp::Options::Url(telegramMainUrl_ + "/sendMessage"));
|
||||||
request.setOpt(new curlpp::Options::Verbose(false));
|
request.setOpt(new curlpp::Options::Verbose(true));
|
||||||
request.setOpt(new curlpp::Options::ReadStream(&requestStream));
|
request.setOpt(new curlpp::Options::ReadStream(&requestStream));
|
||||||
request.setOpt(new curlpp::options::WriteStream(&responseStream));
|
request.setOpt(new curlpp::Options::WriteStream(&responseStream));
|
||||||
request.setOpt(new curlpp::Options::InfileSize(size));
|
request.setOpt(new curlpp::Options::InfileSize(size));
|
||||||
request.setOpt(new curlpp::options::HttpHeader(headers));
|
request.setOpt(new curlpp::Options::HttpHeader(headers));
|
||||||
request.setOpt(new curlpp::Options::Post(true));
|
request.setOpt(new curlpp::Options::Post(true));
|
||||||
|
|
||||||
// Perform request
|
// Perform request
|
||||||
|
|
@ -172,6 +174,10 @@ public:
|
||||||
curlpp::Easy request;
|
curlpp::Easy request;
|
||||||
std::stringstream responseStream;
|
std::stringstream responseStream;
|
||||||
|
|
||||||
|
std::list<std::string> headers;
|
||||||
|
headers.push_back("Expect:");
|
||||||
|
request.setOpt(new curlpp::Options::HttpHeader(headers));
|
||||||
|
|
||||||
{
|
{
|
||||||
// Forms takes ownership of pointers!
|
// Forms takes ownership of pointers!
|
||||||
curlpp::Forms formParts;
|
curlpp::Forms formParts;
|
||||||
|
|
@ -183,7 +189,7 @@ public:
|
||||||
|
|
||||||
// Set options
|
// Set options
|
||||||
request.setOpt(new curlpp::Options::Url(telegramMainUrl_ + "/sendPhoto"));
|
request.setOpt(new curlpp::Options::Url(telegramMainUrl_ + "/sendPhoto"));
|
||||||
request.setOpt(new curlpp::Options::Verbose(false));
|
request.setOpt(new curlpp::Options::Verbose(true));
|
||||||
request.setOpt(new curlpp::options::WriteStream(&responseStream));
|
request.setOpt(new curlpp::options::WriteStream(&responseStream));
|
||||||
|
|
||||||
// Perform request
|
// Perform request
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue