
Originally Posted by
ber_44
Read the header location.... from first url and grab the next url ....
on your case
QString QHttpHeader::value ("Location")
return the new url or path...
sample read ....
depend on ip client ... grab the next url mirror....
{
ActualCook.clear();
QStringList cookielist
= responseHeader.
allValues("set-cookie");
for (int i = 0; i < cookielist.size(); ++i) {
QString cokeline
= cookielist.
at(i
);
QString cookiename
= onlines.
at(0);
QString cookievalue
= onlines.
at(1);
ActualCook.
insert(i,
QStringList() << cookiename << Url_Decode
(cookievalue
) << actualurl
);
/////////////////qDebug() << "### entry set-cookie pos=" << i << " name= " << cookiename << " value=" << Url_Decode(cookievalue);
}
//////////emit WatReturn(QString("One code=%1 - Other say = %2 \n%3").arg( responseHeader.statusCode() ).arg( responseHeader.reasonPhrase() ).arg(CookieVars()) );
}
void RegisterCookie(const QHttpResponseHeader &responseHeader )
{
ActualCook.clear();
QStringList cookielist = responseHeader.allValues("set-cookie");
for (int i = 0; i < cookielist.size(); ++i) {
QString cokeline = cookielist.at(i);
QStringList onlines = cokeline.split("=");
QString cookiename = onlines.at(0);
QString cookievalue = onlines.at(1);
ActualCook.insert(i,QStringList() << cookiename << Url_Decode(cookievalue) << actualurl);
/////////////////qDebug() << "### entry set-cookie pos=" << i << " name= " << cookiename << " value=" << Url_Decode(cookievalue);
}
//////////emit WatReturn(QString("One code=%1 - Other say = %2 \n%3").arg( responseHeader.statusCode() ).arg( responseHeader.reasonPhrase() ).arg(CookieVars()) );
}
To copy to clipboard, switch view to plain text mode
discovery on http://livehttpheaders.mozdev.org/
http://downloads.sourceforge.net/isisimages/source.zip
GET /isisimages/source.zip HTTP/1.1
Host: downloads.sourceforge.net
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: it-it,it;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.qtcentre.org/forum//forum/newreply.php?do=postreply&t=6595
Cookie: ebNewBandWidth_.sourceforge.net=589%3A1175362503265; __utmz=191645736.1176795478.834.46.utmccn=(referral)|utmcsr=qtcentre.org|utmcct=/forum/f-qt-programming-2/t-how-to-make-qhttp-work-with-this-url-6595.html|utmcmd=referral; username=gasSKXJewRo%3D; __utma=191645736.346796218.1169658266.1176747181.1176795478.834; sso_session_ser=yKK3e8LVW6r8auGwiHUNePItpalud5j%2B54olwzSzS4soMkSBvWa4R%2BJEPm6Wn30sQiHC17XThHPg3KMsC2qEPizzVh%2FYdN2K0Ec75%2FtfH%2B8mVoAtmF0bDYklJOqyuyLa%2B4%2BQqU5aYeW2GfRW%2FqCBbnKjYuiyNGIdc0g5ydI5sBQ%3D-5ead3f2617584e562295ee6a3be43f78; __utmc=191645736; __utmb=191645736
HTTP/1.x 301 Moved Permanently
X-Powered-By: PHP/5.2.1
Location: http://sourceforge.net/project/downloading.php?groupname=isisimages&filename=source.zip&use_mirror=heanet
Content-Type: text/html
Content-Length: 0
Date: Tue, 17 Apr 2007 07:54:32 GMT
Server: lighttpd/1.4.15
----------------------------------------------------------
http://downloads.sourceforge.net/isisimages/source.zip
GET /isisimages/source.zip HTTP/1.1
Host: downloads.sourceforge.net
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: it-it,it;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.qtcentre.org/forum//forum/newreply.php?do=postreply&t=6595
Cookie: ebNewBandWidth_.sourceforge.net=589%3A1175362503265; __utmz=191645736.1176795478.834.46.utmccn=(referral)|utmcsr=qtcentre.org|utmcct=/forum/f-qt-programming-2/t-how-to-make-qhttp-work-with-this-url-6595.html|utmcmd=referral; username=gasSKXJewRo%3D; __utma=191645736.346796218.1169658266.1176747181.1176795478.834; sso_session_ser=yKK3e8LVW6r8auGwiHUNePItpalud5j%2B54olwzSzS4soMkSBvWa4R%2BJEPm6Wn30sQiHC17XThHPg3KMsC2qEPizzVh%2FYdN2K0Ec75%2FtfH%2B8mVoAtmF0bDYklJOqyuyLa%2B4%2BQqU5aYeW2GfRW%2FqCBbnKjYuiyNGIdc0g5ydI5sBQ%3D-5ead3f2617584e562295ee6a3be43f78; __utmc=191645736; __utmb=191645736
HTTP/1.x 301 Moved Permanently
X-Powered-By: PHP/5.2.1
Location: http://sourceforge.net/project/downloading.php?groupname=isisimages&filename=source.zip&use_mirror=heanet
Content-Type: text/html
Content-Length: 0
Date: Tue, 17 Apr 2007 07:54:32 GMT
Server: lighttpd/1.4.15
----------------------------------------------------------
To copy to clipboard, switch view to plain text mode
Bookmarks