Results 1 to 2 of 2

Thread: QHttp conundrum

  1. #1
    Join Date
    Aug 2009
    Location
    LOL Land
    Posts
    9
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QHttp conundrum

    NOTE: Be sure that if you supply an answer to actually test it against https://api.sandbox.ebay.com/ws/api.dll because I think something fishy is happening.

    I can't get QHttp to retrieve (via GET) https://api.sandbox.ebay.com/ws/api.dll. Doing so should yield the following response text(which is exactly what you get if you use a browser to retrieve it).
    <?xml version="1.0" encoding="UTF-8" ?><eBay><EBayTime>2009-08-19 23:12:41</EBayTime><Errors><Error><Code>2</Code><ErrorClass>RequestError</ErrorClass><SeverityCode>1</SeverityCode><Severity>SeriousError</Severity><Line>0</Line><Column>0</Column><ShortMessage><![CDATA[ Unsupported verb. ]]></ShortMessage></Error></Errors></eBay>
    So... why doesnt this code doesnt work?

    note: GTest inherits QHttp
    Qt Code:
    1. void GTest::start(void)
    2. {
    3. QHttpRequestHeader header("GET", "https://api.sandbox.ebay.com/ws/api.dll");
    4. header.setValue("Host", "api.sandbox.ebay.com");
    5. setHost("api.sandbox.ebay.com", QHttp::ConnectionModeHttps);
    6. request(header);
    7. }
    To copy to clipboard, switch view to plain text mode 

    I have hooked up all the signals to slots and they give the details of the state of the connection. This is the output i got

    Qt Code:
    1. RequestStarted() id: 1
    2. RequestFinished()
    3. {
    4. id: 1
    5. error: false
    6. error code: 0
    7. error message: Unknown error
    8. start returned data
    9.  
    10. end returned data
    11. }
    12. RequestStarted() id: 2
    13. StateChanged() state: 2
    14. StateChanged() state: 3
    15. RequestFinished()
    16. {
    17. id: 2
    18. error: true
    19. error code: 1
    20. error message: HTTP request failed
    21. start returned data
    22.  
    23. end returned data
    24. }
    25. AllFinished() error: true
    26. StateChanged() state: 6
    27. StateChanged() state: 0
    To copy to clipboard, switch view to plain text mode 


    The full code is attached. It's completely stripped down to only do this test.
    Attached Files Attached Files

  2. #2
    Join Date
    Jun 2008
    Location
    Germany/Belarus/Sweden
    Posts
    53
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QHttp conundrum

    Your code work without any problem....

    RequestStarted() id: 1RequestFinished()
    {
    id: 1
    error: false
    error code: 0
    error message: Unknown error
    start returned data

    end returned data
    }RequestStarted() id: 2StateChanged() state: 2StateChanged() state: 3DataSendProgress() done: 84 total: 84StateChanged() state: 4ResponseHeader()
    {
    HTTP/1.1 200 OK
    Date: Thu, 20 Aug 2009 10:02:38 GMT
    Server: Microsoft-IIS/5.0
    X-EBAY-API-POOL-NAME: ___cDRidW90YmtiZWx9b2l3aQ==
    X-EBAY-API-SERVER-NAME: ___dXYuc3F0YWR2bjM1NygyNSgwLTQ2MS03Nj85PTY/Mg==
    Content-Type: text/xml
    Content-Length: 330
    X-Cache: MISS from sjcsbapigw01.sjc.ebay.com, MISS from sjcsbapigw01.sjc.ebay.com
    Connection: close


    }DataReadProgress() done: 330 total: 330StateChanged() state: 6StateChanged() state: 0RequestFinished()
    {
    id: 2
    error: false
    error code: 0
    error message: Unknown error
    start returned data
    <?xml version="1.0" encoding="UTF-8" ?><eBay><EBayTime>2009-08-20 10:03:53</EBayTime><Errors><Error><Code>2</Code><ErrorClass>RequestError</ErrorClass><SeverityCode>1</SeverityCode><Severity>SeriousError</Severity><Line>0</Line><Column>0</Column><ShortMessage><![CDATA[ Unsupported verb. ]]></ShortMessage></Error></Errors></eBay>
    end returned data
    }AllFinished() error: false

Similar Threads

  1. new QHttp() Error
    By fengtian.we in forum Qt Programming
    Replies: 7
    Last Post: 6th October 2010, 17:56
  2. problem in using QHttp
    By Ferdous in forum Newbie
    Replies: 4
    Last Post: 10th September 2008, 12:07
  3. From QHttp to QHttp over SSL
    By Nyphel in forum Newbie
    Replies: 1
    Last Post: 3rd July 2007, 10:41
  4. QHttp with localhost.
    By William Wilson in forum Qt Programming
    Replies: 3
    Last Post: 30th June 2007, 20:26
  5. how to use QHttp inside QThread in Qt3
    By alusuel in forum Qt Programming
    Replies: 3
    Last Post: 14th July 2006, 11:19

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.