PDA

View Full Version : Http client problem



losiem
25th August 2009, 12:33
Hi

I have the simple http client based on "HTTP Client" from QT Demos.
Everything works OK except some url's containing special characters (&;,)

For exapmle the url "http://www.futsal-karlowice.pl.tl/Wyniki-spotka%26%23324%3B-.-.htm" which is opening properly in the IE, FFox and even FlashGet can download them, in the sample HTTP client generated error "Download failed: Not found"

How shoud I enter the address for correct downloading?

greetings
Ryszard

yogeshgokul
25th August 2009, 12:42
Everything works OK except some url's containing special characters (&;,)
"&" is not a specil character in case of URL. Its default pair delimiter.


How shoud I enter the address for correct downloading?
If this is a download URL, then you have to handle it yourself. Using GET command.

Can you paste the URL which is not working in your case.

losiem
25th August 2009, 12:50
>>Can you paste the URL which is not working in your case

http://www.futsal-karlowice.pl.tl/Wyniki-spotka%26%23324%3B-.-.htm

The other sites (without '%26...') from this domain work OK.

yogeshgokul
25th August 2009, 12:54
Try:

QByteArray QUrl::toPercentEncoding ( const QString & input,
const QByteArray & exclude = QByteArray(),
const QByteArray & include = QByteArray())

losiem
25th August 2009, 13:01
Try:

QByteArray QUrl::toPercentEncoding ( const QString & input,
const QByteArray & exclude = QByteArray(),
const QByteArray & include = QByteArray())

You mean somtenihg lik this ?

QByteArray path = QUrl::toPercentEncoding(url.path(), "!$&'()*+,;=:@/");
if (path.isEmpty())
path = "/";
httpGetId = http->get(path, file);

This is part of code from the sample HHTP client.
I tried with/without that. I always got "Not found".

Did you try to donload the specified url using the sample HHTP client ?
Maybe the reason is insiade my local network (proxy or other thing) ?
I'm not specialist in the network things.

yogeshgokul
25th August 2009, 13:11
I tried with/without that. I always got "Not found".
Can you try the reverse of this like :

fromPercentEncoding();



Did you try to donload the specified url using the sample HHTP client
Yes successfully.



Maybe the reason is insiade my local network (proxy or other thing) ?
It cant be, because proxy will block IE too.