使用curlpp
C++包装器来发送POST请求的JSON负载,以及如何接收响应中的JSON负载? 接下来该怎么做:
std::string json("{}");
std::list<std::string> header;
header.push_back("Content-Type: application/json");
cURLpp::Easy r;
r.setOpt(new curlpp::options::Url(url));
r.setOpt(new curlpp::options::HttpHeader(header));
// set payload from json?
r.perform();
那么,我如何等待(JSON)响应并检索正文内容?