Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QNetworkAccessManager post method with arguments.
Forum Update on Monday, May 27th 2025

QNetworkAccessManager post method with arguments.

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 236 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    Uday More
    wrote on 12 Jun 2020, 13:54 last edited by
    #1

    Hello Team,
    I have to use post method to call the URL"http://myserver:4001/ticket_management/tasks" given below with additional arguments

    1. hours_spent:<float value>
    2. comment:<optional>

    How can post this using QNetworkAccessManager. I tried using QHttpMultiPart but wasn't successful.

    Please can anyone give a sample code on how to form the QHttpMultipart for this post message.

    Thanks in advance.

    P 1 Reply Last reply 12 Jun 2020, 15:55
    0
    • U Uday More
      12 Jun 2020, 13:54

      Hello Team,
      I have to use post method to call the URL"http://myserver:4001/ticket_management/tasks" given below with additional arguments

      1. hours_spent:<float value>
      2. comment:<optional>

      How can post this using QNetworkAccessManager. I tried using QHttpMultiPart but wasn't successful.

      Please can anyone give a sample code on how to form the QHttpMultipart for this post message.

      Thanks in advance.

      P Offline
      P Offline
      Pablo J. Rogina
      wrote on 12 Jun 2020, 15:55 last edited by
      #2

      @Uday-More said in QNetworkAccessManager post method with arguments.:

      with additional arguments

      you may want to look at this SO question to see how QUrlQuery::addQueryItem method is used to care for the param/value pairs which are then sent as part for the data of the POST request

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      U 1 Reply Last reply 15 Jun 2020, 10:57
      3
      • P Pablo J. Rogina
        12 Jun 2020, 15:55

        @Uday-More said in QNetworkAccessManager post method with arguments.:

        with additional arguments

        you may want to look at this SO question to see how QUrlQuery::addQueryItem method is used to care for the param/value pairs which are then sent as part for the data of the POST request

        U Offline
        U Offline
        Uday More
        wrote on 15 Jun 2020, 10:57 last edited by
        #3

        @Pablo-J-Rogina . Done. Thanks resolved the problem.

        1 Reply Last reply
        0

        2/3

        12 Jun 2020, 15:55

        • Login

        • Login or register to search.
        2 out of 3
        • First post
          2/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved