QNetworkaccessmanager - post
Page |
1 |
Hello
When i try to figure out how to use this QNAM and post I Tried this.
I will fill the bytearray with some id (Numeric) and make it as a list.
It works with one value but not with 2 or more and I recive an Unkown error in all of my cases.
Where is the missing part.
The contact to the url— is all right
I fill up the bytearray in a loop
- QByteArray postData;
- for (int i = 0; i < selectedToAck.size(); ++i)
- {
- postData.append("m_iFuelSensor=");
- /*
- * connection();
- *
- * param postdata- bytearray
- *
- * try to do a form post with QNetworkAccessmanager
- */
- {
- }
- /*
- * finishedSlot();
- *
- * param replay- QNetworkReply
- *
- * answer of the post metchod
- */
- {
- QMessageBox msgBox;
- msgBox.setText(tempQ.toString() + " " + reply->errorString());
- int ret = msgBox.exec();
- // "200 OK" received?
- if (statusCodeV.toInt()==200)
- {
- msgBox.setText("Successfull!...");
- int ret = msgBox.exec();
- QMessageBox msgBox;
- msgBox.setText(string );
- msgBox.exec();
- }
- else
- {
- msgBox.setText("UnSuccessfull!...");
- int ret = msgBox.exec();
- }
- selectedToAck.clear();
- setActiveAlarms();
- delete reply;
- delete manager;
- }
20 replies
I even got this in the debugwindow
X Error: BadWindow (invalid Window parameter) 3 Major opcode: 15 (X_QueryTree) Resource id: 0×165b0ef
X Error: BadWindow (invalid Window parameter) 3 Major opcode: 40 (X_TranslateCoords) Resource id: 0×165b0ef
X Error: BadWindow (invalid Window parameter) 3 Major opcode: 15 (X_QueryTree) Resource id: 0×165c579
X Error: BadWindow (invalid Window parameter) 3 Major opcode: 40 (X_TranslateCoords) Resource id: 0×165c579
X Error: BadWindow (invalid Window parameter) 3 Major opcode: 15 (X_QueryTree) Resource id: 0×165e494
X Error: BadWindow (invalid Window parameter) 3 Major opcode: 40 (X_TranslateCoords) Resource id: 0×165e494
- QByteArray postData;
- postData.append("m_iFuelSensor=");
- for (int i = 0; i < selectedToAck.size(); ++i)
More errors
I got the errorcode 302 unknown error when i do my post but it changes the value in the textbox.
if I send one value.
When i changed to get operation I got the errorcode 200 “OK”
If someone have a simple example to show or some great hints to get me go on with this “Problem”
I would be very happy.
You must log in to post a reply. Not a member yet? Register here!


