Results 1 to 13 of 13

Thread: QHttp Post work inkorect

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QHttp Post work inkorect

    We have no idea what you mean by that it doesn't work correctly. What is correct in this case?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    Apr 2012
    Posts
    40
    Platforms
    Unix/X11 Windows

    Default Re: QHttp Post work inkorect

    Post request is the same in Qt and in curl, but correct result is only in curl. Qt give wrong result, like paramtrs ware wrong (but i use the same parametrs in both cases).

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QHttp Post work inkorect

    And what kind of help do you expect from us? Apparently the two requests differ so take a network sniffer and find the difference.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Apr 2012
    Posts
    40
    Platforms
    Unix/X11 Windows

    Default Re: QHttp Post work inkorect

    I want from you to show me how correct configure POST request in QT, because now is somting wrong , the same result i get if i use GET request. Curl show correct result (using this parametrs "name=Gaths&password=qwerasdf&lowRes=1&login=13592 99878&w=") maybe in Qt is different way to do this

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QHttp Post work inkorect

    Get a network sniffer such as wireshark and find out differences between the two requests.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Apr 2012
    Posts
    40
    Platforms
    Unix/X11 Windows

    Default Re: QHttp Post work inkorect

    but i know, that parametrs are good and should work "name=Gaths&password=qwerasdf&lowRes=1&login=1 3592 99878&w="
    name=Gaths
    password=qwerasdf
    lowRes=1
    login=13592 99878
    w=

    And work, but in qt dont work (i do something wrong but i dont know what)

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QHttp Post work inkorect

    Get a network sniffer and find out differences between two requests. You are comparing unencoded body of the request which says nothing about what gets sent to the server. Don't guess what gets sent, check it using tools available. You will see many differences between the two requests, you need to find those that matter (e.g. content encoding header) and correct your request. Your "problem" comes from your apparent limited knowledge about HTTP so either you learn how HTTP works or you mimic a working request. The latter is certainly faster than the former, however you learn much more from the former than the latter.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #8
    Join Date
    Apr 2012
    Posts
    40
    Platforms
    Unix/X11 Windows

    Default Re: QHttp Post work inkorect

    thx for help (i use wireshark), i know what is wrong, it is problem with encoding.

    POST parametrs from firefox IN WIRESHARK look like this:
    "name=Gaths&password=qwerasdf&s1=Login&w=1024%3A60 0&login=1359443665"

    but from qt POST look like this:
    "6e616d234567843234356445678956774343..."

    Can somebody tell me how correctli encode parametrs in qt ?? (my app code is in first post)

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QHttp Post work inkorect

    You need to provide proper encoding for the data.

    http://en.wikipedia.org/wiki/POST_(HTTP)

    It should probably be x-www-form-urlencoded but it looks like base64 now.

    And by the way, I suggest you use QNetworkAccessManager rather than QHttp which has been deprecated for years.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Qhttp:Post() - multipart/form-data
    By arunredi in forum Newbie
    Replies: 5
    Last Post: 20th September 2011, 20:02
  2. QHTTP POST problem
    By oscar in forum Qt Programming
    Replies: 5
    Last Post: 10th October 2009, 19:58
  3. problems in QHttp post method!
    By Longe.W in forum Qt Programming
    Replies: 6
    Last Post: 8th April 2009, 05:21
  4. QHttp::post() - cannot upload file
    By arunredi in forum Qt Programming
    Replies: 5
    Last Post: 16th May 2008, 12:13
  5. QHttp::post() help
    By Funklord in forum Qt Programming
    Replies: 4
    Last Post: 22nd March 2006, 07:10

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
  •  
Qt is a trademark of The Qt Company.