Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. HTTP request POST in QT application QT 5.3.2

HTTP request POST in QT application QT 5.3.2

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 2 Posters 958 Views 1 Watching
  • 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.
  • T Offline
    T Offline
    trex
    wrote on last edited by
    #1

    Hi,
    I want to send the following oauth HTTP POST request using qt netwok apis.

    url: https://accounts.google.com/o/oauth2/token

    POST /accounts/o8/oauth2/token HTTP/1.1
    Host: www.google.com
    Content-Type: application/x-www-form-urlencoded

    client_id=21302922996.apps.googleusercontent.com&
    client_secret=XTHhXh1SlUNgvyWGwDk1EjXB&
    code=4/P7q7W91a-oMsCeLvIaQm6bTrgtp6&
    redirect_uri=urn:ietf:wgauth:2.0ob&
    grant_type=authorization_code

    Can anybody help me out how to use qt api classes QNetworkRequest,QNetworkAccessManager,QNetworkRepl y for the above HTTP POST request.
    I an using raspberry pi 3 QT creator 3.2.1 based on QT 5.3.2.

    Thanks

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      You do realise you have posted your oauth secret here publicly?

      Are you forced to use such an old Qt version? If no, then please consider upgrading to Qt 5.8 or 5.9, where you can use the convenience QtNetworkAuth module.

      If yes, then you have already discovered all relevant classes needed in this case. Read the docs, all info on how to build requests is there. If something is unclear, feel free to ask here, of course.

      (Z(:^

      1 Reply Last reply
      1

      • Login

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