I have a webservice that I need to POST some data to using Qt. I figured that I can use a QByteArray when POSTing to the web service.
My question is, how can I forma
Here is another way to handle this, i am using your code also to give a complete code:
// Setup the webservice url
QUrl serviceUrl = QUrl("http://myserver/myservice.asmx");
QByteArray postData;
QUrl params;
params.addQueryItem("param1","string1");
params.addQueryItem("param2","string2");
postData = params.encodedQuery();
// Call the webservice
QNetworkAccessManager *networkManager = new QNetworkAccessManager(this);
connect(networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(serviceRequestFinished(QNetworkReply*)));
networkManager->post(QNetworkRequest(serviceUrl), postData);