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.