summaryrefslogtreecommitdiff
path: root/libtmdb/httpClient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libtmdb/httpClient.cpp')
-rw-r--r--libtmdb/httpClient.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/libtmdb/httpClient.cpp b/libtmdb/httpClient.cpp
index 6217f1a..a4b4eb7 100644
--- a/libtmdb/httpClient.cpp
+++ b/libtmdb/httpClient.cpp
@@ -41,15 +41,15 @@ namespace TMDb {
static size_t
appendString(void * contents, size_t size, size_t nmemb, void * userp)
{
- auto data = static_cast<Glib::ustring *>(userp);
- data->append(static_cast<const char *>(contents), size * nmemb);
+ auto data = static_cast<std::stringstream *>(userp);
+ data->write(static_cast<const char *>(contents), size * nmemb);
return size * nmemb;
}
json::Value
HttpClient::FetchJson(const std::string & path) const
{
- Glib::ustring jsonData;
+ std::stringstream jsonData;
struct curl_slist *headers = NULL;
curl_slist_append(headers, "Accept: application/json");
@@ -69,8 +69,7 @@ namespace TMDb {
throw TMDb::HttpException(http_code);
}
- Glib::ustring::const_iterator itr = jsonData.begin();
- return json::parseValue(itr);
+ return json::parseValue(jsonData);
}
}