Results 1 to 6 of 6

Thread: Http client problem

  1. #1
    Join Date
    Jul 2008
    Posts
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Http client problem

    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

  2. #2
    Join Date
    Dec 2007
    Posts
    627
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Http client problem

    Quote Originally Posted by losiem View Post
    Everything works OK except some url's containing special characters (&;,)
    "&" is not a specil character in case of URL. Its default pair delimiter.

    Quote Originally Posted by losiem View Post
    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.

  3. #3
    Join Date
    Jul 2008
    Posts
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Http client problem

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

    http://www.futsal-karlowice.pl.tl/Wy...3324%3B-.-.htm

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

  4. #4
    Join Date
    Dec 2007
    Posts
    627
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Http client problem

    Try:
    Qt Code:
    1. QByteArray QUrl::toPercentEncoding ( const QString & input,
    2. const QByteArray & exclude = QByteArray(),
    3. const QByteArray & include = QByteArray())
    To copy to clipboard, switch view to plain text mode 

  5. #5
    Join Date
    Jul 2008
    Posts
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Http client problem

    Quote Originally Posted by yogeshgokul View Post
    Try:
    Qt Code:
    1. QByteArray QUrl::toPercentEncoding ( const QString & input,
    2. const QByteArray & exclude = QByteArray(),
    3. const QByteArray & include = QByteArray())
    To copy to clipboard, switch view to plain text mode 
    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.

  6. #6
    Join Date
    Dec 2007
    Posts
    627
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Http client problem

    Quote Originally Posted by losiem View Post
    I tried with/without that. I always got "Not found".
    Can you try the reverse of this like :
    Qt Code:
    1. fromPercentEncoding();
    To copy to clipboard, switch view to plain text mode 


    Qt Code:
    1. Did you try to donload the specified url using the sample HHTP client
    To copy to clipboard, switch view to plain text mode 
    Yes successfully.

    Quote Originally Posted by losiem View Post
    Maybe the reason is insiade my local network (proxy or other thing) ?
    It cant be, because proxy will block IE too.

Similar Threads

  1. HTTP GET authentication does not proceed
    By SailingDreams in forum Qt Programming
    Replies: 2
    Last Post: 1st June 2009, 01:27
  2. QHTTP does not see tunneled TCP HTTP OK authentication response
    By SailingDreams in forum Qt Programming
    Replies: 6
    Last Post: 23rd May 2009, 09:39
  3. Weird problem: multithread QT app kills my linux
    By Ishark in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 09:12
  4. Steps in solving a programming problem?
    By triperzonak in forum General Programming
    Replies: 8
    Last Post: 5th August 2008, 08:47
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.