Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved QNetworkAccessManager post method with arguments.

    General and Desktop
    2
    3
    100
    Loading More Posts
    • 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
      Uday More last edited by

      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.

      Pablo J. Rogina 1 Reply Last reply Reply Quote 0
      • Pablo J. Rogina
        Pablo J. Rogina @Uday More last edited by

        @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 Reply Quote 3
        • U
          Uday More @Pablo J. Rogina last edited by

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

          1 Reply Last reply Reply Quote 0
          • First post
            Last post