# HG changeset patch # User Sebastien Jodogne # Date 1466237147 -7200 # Node ID 7fe860db966471446698f00fc46cb629aed65d79 # Parent fefbe71c2272fef297201a5e111ffe19c312d8bf rename diff -r fefbe71c2272 -r 7fe860db9664 Core/HttpClient.cpp --- a/Core/HttpClient.cpp Fri Jun 17 17:09:50 2016 +0200 +++ b/Core/HttpClient.cpp Sat Jun 18 10:05:47 2016 +0200 @@ -298,7 +298,7 @@ } - static size_t CurlCallback(void *buffer, size_t size, size_t nmemb, void *payload) + static size_t CurlBodyCallback(void *buffer, size_t size, size_t nmemb, void *payload) { std::string& target = *(static_cast(payload)); @@ -331,7 +331,7 @@ throw OrthancException(ErrorCode_NotEnoughMemory); } - CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_WRITEFUNCTION, &CurlCallback)); + CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_WRITEFUNCTION, &CurlBodyCallback)); CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_HEADER, 0)); CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_FOLLOWLOCATION, 1)); @@ -436,7 +436,7 @@ } - bool HttpClient::Apply(std::string& answer) + bool HttpClient::ApplyInternal(std::string& answer) { answer.clear(); CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_URL, url_.c_str())); @@ -635,6 +635,12 @@ } + bool HttpClient::Apply(std::string& answer) + { + return ApplyInternal(answer); + } + + bool HttpClient::Apply(Json::Value& answer) { std::string s; diff -r fefbe71c2272 -r 7fe860db9664 Core/HttpClient.h --- a/Core/HttpClient.h Fri Jun 17 17:09:50 2016 +0200 +++ b/Core/HttpClient.h Sat Jun 18 10:05:47 2016 +0200 @@ -69,6 +69,8 @@ void operator= (const HttpClient&); // Assignment forbidden HttpClient(const HttpClient& base); // Copy forbidden + bool ApplyInternal(std::string& answer); + public: HttpClient();