Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-64938

Add a mean to set headers on authenticated network requests

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 5.10.0 RC2, 5.10.0
    • None

    Description

      QAbstractOAuth2::get() can be used to send authenticated request, but it does not provide any mean to set custom headers. Such headers may be required for web API that require a header with the API Key.

      I see 2 ways to solve this:

      • Add a get() function that takes a `QNetworkRequest` parameter so that the user can set its headers beforehand.
      • Add a function that "authenticates" a `QNetworkRequest` and then the user can send it with its own network access manager.

      The current alternative is to get the token from QAbstractOAuth2 and manually add the "Bearer" header. On a side note, the current API does not provide a mean to retrieve the token type, so we cannot even know if "Bearer" is the right protocol.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jefernan Jesus Fernandez
            bterrier Benjamin Terrier
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes