payload.cpp
Go to the documentation of this file.
00001 #include "cpr/payload.h"
00002 
00003 #include <initializer_list>
00004 #include <string>
00005 
00006 #include "cpr/util.h"
00007 
00008 namespace cpr {
00009 
00010 Payload::Payload(const std::initializer_list<Pair>& pairs) : Payload(begin(pairs), end(pairs)) {}
00011 
00012 void Payload::AddPair(const Pair& pair) {
00013     if (!content.empty()) {
00014         content += "&";
00015     }
00016     auto escaped = cpr::util::urlEncode(pair.value);
00017     content += pair.key + "=" + escaped;
00018 }
00019 
00020 } // namespace cpr


rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:05