【发布时间】:2010-12-05 01:38:22
【问题描述】:
如何从 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 实例。如果您需要更多详细信息,可以找到我的源代码here
提前致谢。
【问题讨论】: