1 //! \file CurlUrlCreator.cpp
3 #include "CurlUrlCreator.h"
5 CurlUrlCreator::CurlUrlCreator(std::string baseUrl
)
8 curl_global_init(CURL_GLOBAL_ALL
);
9 handle
= curl_easy_init();
12 CurlUrlCreator::~CurlUrlCreator()
14 curl_easy_cleanup(handle
);
15 curl_global_cleanup();
18 CurlUrlCreator
& CurlUrlCreator::addParameter(std::string param
, std::string value
)
21 char* eval
= curl_easy_escape(handle
, value
.c_str(), 0);
27 std::string
CurlUrlCreator::buildUrl() const
29 std::string ret
= _baseUrl
;
32 for(auto parpair
: args
) {
33 ret
.append(parpair
.first
).append("=").append(parpair
.second
).append("&");
41 void CurlUrlCreator::reset()