Results 1 to 2 of 2

Thread: Generint Post Method

  1. #1
    Join Date
    Jan 2008
    Posts
    39
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Smile Generint Post Method

    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.

  2. #2
    Join Date
    Dec 2010
    Location
    Tarnów, Poland/Polska
    Posts
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Generint Post Method

    Qt Code:
    1. connect(&nvm, SIGNAL(finished(QNetworkReply*)), this, SLOT(connector(QNetworkReply*)));
    2.  
    3. QNetworkRequest request(QUrl("string for your url"));
    4. request.setHeader(QNetworkRequest::ContentTypeHeader,"application/x-www-form-urlencoded");
    5.  
    6. QByteArray data;
    7.  
    8. data.append("first_item=first_variable");
    9. data.append("&second_item=second_variable")
    10.  
    11. nvm.post(request, data);
    To copy to clipboard, switch view to plain text mode 

    Remember you have to craete your own slot named connector (in my case you can name it as you want)

Similar Threads

  1. Replies: 0
    Last Post: 28th February 2011, 09:10
  2. HTTP POST method
    By Macok in forum Qt Programming
    Replies: 5
    Last Post: 25th July 2010, 14:33
  3. Method POST using QTcpServer ?
    By fitzy in forum Qt Programming
    Replies: 1
    Last Post: 27th October 2009, 23:36
  4. Http Post method help
    By ravirdv in forum Qt Programming
    Replies: 0
    Last Post: 27th September 2009, 12:15
  5. problems in QHttp post method!
    By Longe.W in forum Qt Programming
    Replies: 6
    Last Post: 8th April 2009, 05:21

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.