Using QOAuth2AuthorizationCodeFlow
to authorize with google's oauth2. The authorization is successful as well as using GET
request (for example, obtaining list of videos from youtube channel).
But while QNetworkAccessManager
provides user with a bunch of post
method overloads:
QNetworkReply * post(const QNetworkRequest &request, QIODevice *data)
QNetworkReply * post(const QNetworkRequest &request, const QByteArray &data)
QNetworkReply * post(const QNetworkRequest &request, QHttpMultiPart *multiPart)
QOAuth2AuthorizationCodeFlow
has only:
QNetworkReply *post(const QUrl &url, const QVariantMap ¶meters = QVariantMap());
It's easy to append a file using QHttpMultiPart
& QHttpPart::setBodyDevice()
. But I'm not sure how to use QVariantMap
for video/file uploading.
Also, tried to use: QOAuth2AuthorizationCodeFlow::networkAccessManager()
to get access to underlying network manager, but it gives 202 response code with GET
. And, if using with authenticated url, QOAuth2AuthorizationCodeFlow::createAuthenticatedUrl()
, the response code is 200, but reply content is empty (readAll() returns empty buffer). Doesn't work with POST
as well.
Using QT 2nd day, so I may misunderstand some concepts. Thanks for any help & ideas.