Well, I just took the official HTTP example by Qt, and added your code to it:
{
// handle redirections
if (responseHeader.statusCode() >= 300 &&
responseHeader.statusCode() < 400 &&
responseHeader.hasKey("location")) {
http->get(responseHeader.value("location"));
return;
}
if (responseHeader.statusCode() != 200)
//...
}
void HttpWindow::readResponseHeader(const QHttpResponseHeader &responseHeader)
{
// handle redirections
if (responseHeader.statusCode() >= 300 &&
responseHeader.statusCode() < 400 &&
responseHeader.hasKey("location")) {
http->get(responseHeader.value("location"));
return;
}
if (responseHeader.statusCode() != 200)
//...
}
To copy to clipboard, switch view to plain text mode
Bookmarks