如何从 curlpp 请求中检索响应 cookie?
我想从 HTTP GET 请求中存储 PHP 会话。这是我当前的代码:
void Grooveshark::Connection::processPHPCookie()
{
std::ostringstream buffer;
gsDebug("Processing PHP cookie...");
try {
request.setOpt<cURLpp::Options::Url>("http://listen.grooveshark.com");
request.setOpt<cURLpp::Options::WriteStream>(&buffer);
request.perform();
// Get the PHP Session cookie here..
} catch (cURLpp::LogicError& exception) {
gsError(exception.what());
} catch (cURLpp::RuntimeError& exception) {
gsError(exception.what());
}
gsDebug("Processing complete...");
}
request
是一个cURLpp::Easy
实例。如果您需要更多详细信息,可以在这里找到我的源代码
提前致谢。