QT5 - Posting JSON in server not working.
-
wrote on 27 Jun 2013, 07:30 last edited by
Hi friends,
Here is my code, i'm trying to post my json in server but its not working, can u plz help me..
I'm using QT5 version.@QVariantMap top;
top.insert( "email", QString( "test@gmail.com" ) );
top.insert( "test", QString( "test123" ) );
const QJsonDocument doc = QJsonDocument::fromVariant(top);
QByteArray postData;postData = doc.toJson();
QString strData;
strData = doc.toJson();QNetworkAccessManager manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply)),
this, SLOT(replyFinished(QNetworkReply*)));manager->get(QNetworkRequest(QUrl("http:/..../licenses")));
QNetworkRequest req;
req.setUrl(QUrl("http:/..../licenses"));
req.setHeader(QNetworkRequest::ContentTypeHeader,"application/json");
manager->Accessible;
QNetworkReply *reply=manager->post(req,postData);
connect(reply,SIGNAL(uploadProgress(qint64,qint64)),this,SLOT(updateProgress(qint64,qint64)));@Thanks
Jeyaraman S -
wrote on 27 Jun 2013, 07:35 last edited by
Please,
don't post the same thread on multiple Forum
-
wrote on 27 Jun 2013, 07:47 last edited by
I'm new to this forum, can u tell/help me how to remove the duplicate post?
-
wrote on 27 Jun 2013, 08:14 last edited by
Hi,
I don't know how you can delete post, try contacting Forum Moderator.
You can try editing Thread title adding "[REMOVE]"
-
wrote on 27 Jun 2013, 09:42 last edited by
Hi,
ok, Thx. i have reported to moderator..
1/5