Gravis
20th August 2009, 03:14
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
void GTest::start(void)
{
QHttpRequestHeader header("GET", "https://api.sandbox.ebay.com/ws/api.dll");
header.setValue("Host", "api.sandbox.ebay.com");
setHost("api.sandbox.ebay.com", QHttp::ConnectionModeHttps);
request(header);
}
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
RequestStarted() id: 1
RequestFinished()
{
id: 1
error: false
error code: 0
error message: Unknown error
start returned data
end returned data
}
RequestStarted() id: 2
StateChanged() state: 2
StateChanged() state: 3
RequestFinished()
{
id: 2
error: true
error code: 1
error message: HTTP request failed
start returned data
end returned data
}
AllFinished() error: true
StateChanged() state: 6
StateChanged() state: 0
The full code is attached. It's completely stripped down to only do this test.
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
void GTest::start(void)
{
QHttpRequestHeader header("GET", "https://api.sandbox.ebay.com/ws/api.dll");
header.setValue("Host", "api.sandbox.ebay.com");
setHost("api.sandbox.ebay.com", QHttp::ConnectionModeHttps);
request(header);
}
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
RequestStarted() id: 1
RequestFinished()
{
id: 1
error: false
error code: 0
error message: Unknown error
start returned data
end returned data
}
RequestStarted() id: 2
StateChanged() state: 2
StateChanged() state: 3
RequestFinished()
{
id: 2
error: true
error code: 1
error message: HTTP request failed
start returned data
end returned data
}
AllFinished() error: true
StateChanged() state: 6
StateChanged() state: 0
The full code is attached. It's completely stripped down to only do this test.