summaryrefslogtreecommitdiffstats
path: root/src/oauth/qabstractoauth.h
diff options
context:
space:
mode:
authorJesus Fernandez <jesus.fernandez@qt.io>2017-01-18 20:01:11 +0100
committerJesús Fernández <jesus.fernandez@qt.io>2017-01-31 13:20:36 +0000
commit155624c3772b86145d8d84dbca87ab85e8c9c571 (patch)
tree854b94ac5aaeff0012a3b0c241288a9d58182ad5 /src/oauth/qabstractoauth.h
parent1f5d0bbcf5a581a67aad97564fb696f180462967 (diff)
Give clients control over Content-Type in POST methods
Allows sending custom data in POST commands. Some web services do not support sending the data as a query. The user will have total control of the data sent. Change-Id: I8228c9a13f40ca1d06796b08b34030ef2ff14b1f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/oauth/qabstractoauth.h')
-rw-r--r--src/oauth/qabstractoauth.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/oauth/qabstractoauth.h b/src/oauth/qabstractoauth.h
index 2a9e185..291f106 100644
--- a/src/oauth/qabstractoauth.h
+++ b/src/oauth/qabstractoauth.h
@@ -64,6 +64,10 @@ class Q_OAUTH_EXPORT QAbstractOAuth : public QObject
READ authorizationUrl
WRITE setAuthorizationUrl
NOTIFY authorizationUrlChanged)
+ Q_PROPERTY(QAbstractOAuth::ContentType contentType
+ READ contentType
+ WRITE setContentType
+ NOTIFY contentTypeChanged)
public:
enum class Status {
@@ -89,6 +93,11 @@ public:
OAuthCallbackNotVerified
};
+ enum class ContentType {
+ WwwFormUrlEncoded,
+ Json
+ };
+
typedef std::function<void(Stage, QVariantMap*)> ModifyParametersFunction;
virtual ~QAbstractOAuth();
@@ -124,6 +133,9 @@ public:
ModifyParametersFunction modifyParametersFunction() const;
void setModifyParametersFunction(const ModifyParametersFunction &modifyParametersFunction);
+ ContentType contentType() const;
+ void setContentType(ContentType contentType);
+
public Q_SLOTS:
virtual void grant() = 0;
@@ -133,6 +145,7 @@ Q_SIGNALS:
void statusChanged(Status status);
void authorizationUrlChanged(const QUrl &url);
void extraTokensChanged(const QVariantMap &tokens);
+ void contentTypeChanged(ContentType contentType);
void requestFailed(const Error error);
void authorizeWithBrowser(const QUrl &url);