PDA

View Full Version : QHTTP::GET doesn't work as expected !



tuthmosis
22nd July 2008, 14:12
Greetings !

My need is simple ! I try to create a C++ program that can read html pages generated by a Google search path.
(i.e. http://www.google.ca/search?hl=en&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=alligator&spell=1)

I use the sample tool available at http://doc.trolltech.com/4.4/network-http.html

As you can see, it needs a http path to download the html file and place it on a file on the local HD.

The problem is that the file is always "302 Found" !!!!! containing the following html text:


<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.com/webhp">here</A>.
</BODY></HTML>


If you place the following path in Firefox, ....
http://www.google.ca/search?hl=en&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=alligator&spell=1

...you will get a valid search result page !!!!!

So what am i doing wrong here ????
Thanks for any help !

jpn
27th July 2008, 15:45
Works for me with a minimal compilable example...