Grisu
31st December 2012, 12:01
Hi,
I've just installed QT 5.0 and realized that QHttp has been removed.
I'm using it for downloading an XML-reply from Amazon Webservices.
I tried to redesign my code.
With a simple Adress "www.google.de" it's working.
Here is a code snipped:
...
m_netManager = new QNetworkAccessManager(this);
QUrl url("http://webservices.amazon.de/onca/xml?AWSAccessKeyId=1HXFTRJCMBZPF4PGQ2G2&AssociateTag=wwwsealsoftde-20&IdType=EAN&ItemId=5051890049414&Operation=ItemLookup&ResponseGroup=Images%2CItemAttributes%2CRequest%2C EditorialReview&SearchIndex=All&Service=AWSECommerceService&Timestamp=2012-12-31T11%3A03%3A27Z&Signature=M6P6gs%2FXQ6pUnK8ZqZq9LThV7Tf%2FM5J6GYfI 8Qdgt3Q%3D");
m_netRequest.setUrl(url);
m_netReplyData = m_netManager->get(m_netRequest);
connect(m_netReplyData, SIGNAL(error(QNetworkReply::NetworkError)),
this, SLOT(slotErrorData(QNetworkReply::NetworkError)));
...
void HttpData::slotErrorData(QNetworkReply::NetworkErro r code){
qDebug()<<"HttpData::slotErrorData";
if(code == QNetworkReply::OperationCanceledError){
...
}else{
qDebug()<<"Errorstring: "<< m_netReplyData->errorString();
qDebug()<<"Errorcode"<<code;
This is the Errorstring:
http://webservices.amazon.de/onca/xml?AWSAccessKeyId=1HXFTRJCMBZPF4PGQ2G2&AssociateTag=wwwsealsoftde-20&IdType=EAN&ItemId=5051890049414&Operation=ItemLookup&ResponseGroup=Images%2CItemAttributes%2CRequest%2C EditorialReview&SearchIndex=All&Service=AWSECommerceService&Timestamp=2012-12-31T11%3A03%3A27Z&Signature=M6P6gs%2FXQ6pUnK8ZqZq9LThV7Tf%2FM5J6GYfI 8Qdgt3Q%3D - server replied: Bad Request
If this ist not enough code I can write a small sample programm.
Can someone help me with this Problem, with QHttp.get() this code was working?
Greetings,
Grisu
Hi,
I've just installed QT 5.0 and realized that QHttp has been removed.
I'm using it for downloading an XML-reply from Amazon Webservices.
I tried to redesign my code.
With a simple Adress "www.google.de" it's working.
Here is a code snipped:
...
m_netManager = new QNetworkAccessManager(this);
QUrl url("http://webservices.amazon.de/onca/xml?AWSAccessKeyId=1HXFTRJCMBZPF4PGQ2G2&AssociateTag=wwwsealsoftde-20&IdType=EAN&ItemId=5051890049414&Operation=ItemLookup&ResponseGroup=Images%2CItemAttributes%2CRequest%2C EditorialReview&SearchIndex=All&Service=AWSECommerceService&Timestamp=2012-12-31T11%3A03%3A27Z&Signature=M6P6gs%2FXQ6pUnK8ZqZq9LThV7Tf%2FM5J6GYfI 8Qdgt3Q%3D");
m_netRequest.setUrl(url);
m_netReplyData = m_netManager->get(m_netRequest);
connect(m_netReplyData, SIGNAL(error(QNetworkReply::NetworkError)),
this, SLOT(slotErrorData(QNetworkReply::NetworkError)));
...
void HttpData::slotErrorData(QNetworkReply::NetworkErro r code){
qDebug()<<"HttpData::slotErrorData";
if(code == QNetworkReply::OperationCanceledError){
...
}else{
qDebug()<<"Errorstring: "<< m_netReplyData->errorString();
qDebug()<<"Errorcode"<<code;
This is the Errorstring:
http://webservices.amazon.de/onca/xml?AWSAccessKeyId=1HXFTRJCMBZPF4PGQ2G2&AssociateTag=wwwsealsoftde-20&IdType=EAN&ItemId=5051890049414&Operation=ItemLookup&ResponseGroup=Images%2CItemAttributes%2CRequest%2C EditorialReview&SearchIndex=All&Service=AWSECommerceService&Timestamp=2012-12-31T11%3A03%3A27Z&Signature=M6P6gs%2FXQ6pUnK8ZqZq9LThV7Tf%2FM5J6GYfI 8Qdgt3Q%3D - server replied: Bad Request
If this ist not enough code I can write a small sample programm.
Can someone help me with this Problem, with QHttp.get() this code was working?
Greetings,
Grisu
Always the same....
Im working on this for two days. And 30 minutes after this post I got it :-)
m_netRequest.setUrl(QUrl("http://"+strUrl.host()+strUrl.path()));
m_netReplyData = m_netManager->post(m_netRequest,strUrl.encodedQuery());
I've just installed QT 5.0 and realized that QHttp has been removed.
I'm using it for downloading an XML-reply from Amazon Webservices.
I tried to redesign my code.
With a simple Adress "www.google.de" it's working.
Here is a code snipped:
...
m_netManager = new QNetworkAccessManager(this);
QUrl url("http://webservices.amazon.de/onca/xml?AWSAccessKeyId=1HXFTRJCMBZPF4PGQ2G2&AssociateTag=wwwsealsoftde-20&IdType=EAN&ItemId=5051890049414&Operation=ItemLookup&ResponseGroup=Images%2CItemAttributes%2CRequest%2C EditorialReview&SearchIndex=All&Service=AWSECommerceService&Timestamp=2012-12-31T11%3A03%3A27Z&Signature=M6P6gs%2FXQ6pUnK8ZqZq9LThV7Tf%2FM5J6GYfI 8Qdgt3Q%3D");
m_netRequest.setUrl(url);
m_netReplyData = m_netManager->get(m_netRequest);
connect(m_netReplyData, SIGNAL(error(QNetworkReply::NetworkError)),
this, SLOT(slotErrorData(QNetworkReply::NetworkError)));
...
void HttpData::slotErrorData(QNetworkReply::NetworkErro r code){
qDebug()<<"HttpData::slotErrorData";
if(code == QNetworkReply::OperationCanceledError){
...
}else{
qDebug()<<"Errorstring: "<< m_netReplyData->errorString();
qDebug()<<"Errorcode"<<code;
This is the Errorstring:
http://webservices.amazon.de/onca/xml?AWSAccessKeyId=1HXFTRJCMBZPF4PGQ2G2&AssociateTag=wwwsealsoftde-20&IdType=EAN&ItemId=5051890049414&Operation=ItemLookup&ResponseGroup=Images%2CItemAttributes%2CRequest%2C EditorialReview&SearchIndex=All&Service=AWSECommerceService&Timestamp=2012-12-31T11%3A03%3A27Z&Signature=M6P6gs%2FXQ6pUnK8ZqZq9LThV7Tf%2FM5J6GYfI 8Qdgt3Q%3D - server replied: Bad Request
If this ist not enough code I can write a small sample programm.
Can someone help me with this Problem, with QHttp.get() this code was working?
Greetings,
Grisu
Hi,
I've just installed QT 5.0 and realized that QHttp has been removed.
I'm using it for downloading an XML-reply from Amazon Webservices.
I tried to redesign my code.
With a simple Adress "www.google.de" it's working.
Here is a code snipped:
...
m_netManager = new QNetworkAccessManager(this);
QUrl url("http://webservices.amazon.de/onca/xml?AWSAccessKeyId=1HXFTRJCMBZPF4PGQ2G2&AssociateTag=wwwsealsoftde-20&IdType=EAN&ItemId=5051890049414&Operation=ItemLookup&ResponseGroup=Images%2CItemAttributes%2CRequest%2C EditorialReview&SearchIndex=All&Service=AWSECommerceService&Timestamp=2012-12-31T11%3A03%3A27Z&Signature=M6P6gs%2FXQ6pUnK8ZqZq9LThV7Tf%2FM5J6GYfI 8Qdgt3Q%3D");
m_netRequest.setUrl(url);
m_netReplyData = m_netManager->get(m_netRequest);
connect(m_netReplyData, SIGNAL(error(QNetworkReply::NetworkError)),
this, SLOT(slotErrorData(QNetworkReply::NetworkError)));
...
void HttpData::slotErrorData(QNetworkReply::NetworkErro r code){
qDebug()<<"HttpData::slotErrorData";
if(code == QNetworkReply::OperationCanceledError){
...
}else{
qDebug()<<"Errorstring: "<< m_netReplyData->errorString();
qDebug()<<"Errorcode"<<code;
This is the Errorstring:
http://webservices.amazon.de/onca/xml?AWSAccessKeyId=1HXFTRJCMBZPF4PGQ2G2&AssociateTag=wwwsealsoftde-20&IdType=EAN&ItemId=5051890049414&Operation=ItemLookup&ResponseGroup=Images%2CItemAttributes%2CRequest%2C EditorialReview&SearchIndex=All&Service=AWSECommerceService&Timestamp=2012-12-31T11%3A03%3A27Z&Signature=M6P6gs%2FXQ6pUnK8ZqZq9LThV7Tf%2FM5J6GYfI 8Qdgt3Q%3D - server replied: Bad Request
If this ist not enough code I can write a small sample programm.
Can someone help me with this Problem, with QHttp.get() this code was working?
Greetings,
Grisu
Always the same....
Im working on this for two days. And 30 minutes after this post I got it :-)
m_netRequest.setUrl(QUrl("http://"+strUrl.host()+strUrl.path()));
m_netReplyData = m_netManager->post(m_netRequest,strUrl.encodedQuery());