3
如何從curlpp請求中檢索響應cookie?如何通過curlpp檢索響應cookie?
我想將PHP會話存儲在HTTP GET請求之外。這是我當前的代碼:
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
在此先感謝。