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. QOAuth2AuthorizationCodeFlow PATCH request
Qt 6.11 is out! See what's new in the release blog

QOAuth2AuthorizationCodeFlow PATCH request

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 1.3k Views 2 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.
  • J Offline
    J Offline
    josuegomes
    wrote on last edited by
    #1

    Hi,

    With QOAuth2AuthorizationCodeFlow I can send authenticated GET, PUT, DELETE and HEAD requests. But no PATCH.

    Is there a way to do that?
    I need to call [1] with a request body.

    [1] https://developers.google.com/drive/api/v3/reference/files/update

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      From the looks of it, you would have to modify the QtNetworkAuth module and add support for it.

      If you do that, please consider submitting a patch for inclusion :-)

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • J Offline
        J Offline
        josuegomes
        wrote on last edited by
        #3

        Thousands of years ago I tried to submit a PR with no success.

        How to submit a patch these days? Is there a tutorial or something like this?

        raven-worxR 1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          See https://wiki.qt.io/Gerrit_Introduction

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          3
          • J josuegomes

            Thousands of years ago I tried to submit a PR with no success.

            How to submit a patch these days? Is there a tutorial or something like this?

            raven-worxR Offline
            raven-worxR Offline
            raven-worx
            Moderators
            wrote on last edited by
            #5

            @josuegomes
            https://bugreports.qt.io/browse/QTBUG-75935

            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
            If you have a question please use the forum so others can benefit from the solution in the future

            J 1 Reply Last reply
            3
            • raven-worxR raven-worx

              @josuegomes
              https://bugreports.qt.io/browse/QTBUG-75935

              J Offline
              J Offline
              josuegomes
              wrote on last edited by josuegomes
              #6

              @SGaist thank you
              @raven-worx thank you

              As a workaround and for future reference:

                      // in the header
                    	QOAuth2AuthorizationCodeFlow oauth2;
              
                      ....
              
              	QNetworkRequest request;
              	request.setUrl(QUrl{ QString{ "https://www.googleapis.com/drive/v3/files/%1?supportsAllDrives=true" }.arg(fileId) });
              	request.setRawHeader(QByteArray{ "Authorization" }, QString{ "Bearer %1" }.arg(oauth2.token()).toUtf8() );
              	request.setHeader(QNetworkRequest::ContentTypeHeader, QString{ "application/json; charset=UTF-8" }.toUtf8());
              	request.setHeader(QNetworkRequest::ContentLengthHeader, QString{ "19" }.toUtf8());
              
              	QBuffer *buff = new QBuffer;
              	buff->open(QIODevice::ReadWrite);
              	buff->write(QString{ "{ \"trashed\": true }" }.toUtf8());
              	buff->seek(0);
              
              	oauth2.networkAccessManager()->sendCustomRequest(request, "PATCH", buff);
              
              
              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