Important: Please read the Qt Code of Conduct -

QT5 - Posting JSON in server not working.

  • 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( "" ) );
    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*)));


    QNetworkRequest req;
    QNetworkReply *reply=manager->post(req,postData);

    Jeyaraman S

  • Please,

    don't post the same thread on multiple Forum

  • I'm new to this forum, can u tell/help me how to remove the duplicate post?

  • Hi,

    I don't know how you can delete post, try contacting Forum Moderator.

    You can try editing Thread title adding "[REMOVE]"

  • Hi,

    ok, Thx. i have reported to moderator..

Log in to reply