qt - QNetworkAccessManager read outgoingData and keep it in QIODevice -
I am trying to save all outgoing POST data in QtWebKit.
I use the override QNetworkReply * QNetworkAccessManager :: createRequest (Operation session, Constant QN Network, Universal and Request, QIODevice Outgoing Data) and go out Read outgoing data with postal data. The problem is that after reading this, the data is not available in QIODevice. How can save an outgoing (PUT, POST) data and keep it available for future internal QT operations? If I need to use another approach to save PUT / POST data - please, let me know. Code example: I have tried But in this case I get the message "QIODevice :: write: readOnly Device". How can saving outgoing POST / PUT data in QT? Thank you. In the data from the maximum maxsize bytes the device reads, Without side effects (i.e., if you call () after peak, you will get the same data). Returns the number of read bytes. If an error occurs, such as when a single write device is opened, then this function returns -1 0 returns when no other data is available for reading. Edit Forget about the peak (), it is not good in this situation. You can use it but you have to do a lot of work to complete whatever you have to ask. Instead, read the code from there and use it. Linked to #qt irc channel peppe . and thiago who were thanking me for discussing this problem with the #qt channel, would like to thank me. If you come across a question that will get answers and codes in the question to come theft for incoming and outgoing data from QNetworkAccessManager.
QNetworkReply * MyNetworkAccessManager :: createRequest (Operation session, Constant QN NetworkVerified and Request, QIODevice * Outgoing Data) {QByteArray bAray = Outgoing Data-> ReadAll (); // Save hairs (which includes posting outgoing data) do somewhere / other things, and outgoing data no longer has any data, because it was already read by Barre}
QByteArray bAray = outgoing data-> ReadAll (); OutgoingData-> About (bArray); QDebug () & lt; & Lt; BArray;
Comments
Post a Comment