Here is a strange thing I came cross.When I post something using QNetworkAccessManager:
fillContent(content);
qDebug()<<content;
QNetworkAccessManager manager;
manager.post(QNetworkRequest(requestURL),content);
QByteArray content;
fillContent(content);
qDebug()<<content;
QNetworkAccessManager manager;
manager.post(QNetworkRequest(requestURL),content);
To copy to clipboard, switch view to plain text mode
So,I the third line,I can see the output like this:
"signature=LgcuKoofUFtO+LKWPnARcpJyeRo=&signature_ method=HMAC-SHA1"
But when the reply finished,I output the data of reply:
qDebug()<<reply->readAll();
qDebug()<<reply->readAll();
To copy to clipboard, switch view to plain text mode
I get error message from the sever:
"Signature does not match. Expected: LgcuKoofUFtO+LKWPnARcpJyeRo= Got: LgcuKoofUFtO LKWPnARcpJyeRo="
You see,the "+" in the middle of the signature is missing...
It's pretty strange.Does anybody know how to fix it?
BTW,I can't encode the data to percent-encoding(like %20%4Babcde) before calling QNetworkAccessManager.post(),because the sever will assume this is wrong too.
Bookmarks