hi iam new to Qt i am tryng to generate Post method whithing a class.. but i cannot find a way to set the parameters for the POST method using QNetworkAccessManager, some guide will be appreciatting.
Printable View
hi iam new to Qt i am tryng to generate Post method whithing a class.. but i cannot find a way to set the parameters for the POST method using QNetworkAccessManager, some guide will be appreciatting.
Code:
connect(&nvm, SIGNAL(finished(QNetworkReply*)), this, SLOT(connector(QNetworkReply*))); request.setHeader(QNetworkRequest::ContentTypeHeader,"application/x-www-form-urlencoded"); QByteArray data; data.append("first_item=first_variable"); data.append("&second_item=second_variable") nvm.post(request, data);
Remember you have to craete your own slot named connector (in my case you can name it as you want)