summaryrefslogtreecommitdiff
path: root/packages/oauth2
diff options
context:
space:
mode:
authorJulien Danjou <julien@danjou.info>2011-12-20 11:30:30 +0100
committerJulien Danjou <julien@danjou.info>2011-12-20 11:30:30 +0100
commit9002a04be0d1226880354e6c957e62042b458249 (patch)
tree7e9764cb106a17fb10562852303a31a17a877945 /packages/oauth2
parentb8fdaf13c6a681740e0d79a078c2eb375963a007 (diff)
downloademacs-9002a04be0d1226880354e6c957e62042b458249.tar.gz
oauth2: allow to use any HTTP request type
* oauth2: allow to use any HTTP request type
Diffstat (limited to 'packages/oauth2')
-rw-r--r--packages/oauth2/oauth2.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/packages/oauth2/oauth2.el b/packages/oauth2/oauth2.el
index 3b57c05c176..7175606f74d 100644
--- a/packages/oauth2/oauth2.el
+++ b/packages/oauth2/oauth2.el
@@ -178,7 +178,7 @@ This allows to store the token in an unique way."
(defvar success)
;;;###autoload
-(defun oauth2-url-retrieve-synchronously (token url)
+(defun oauth2-url-retrieve-synchronously (token url &optional request-method request-data request-extra-headers)
"Retrieve an URL synchronously using TOKENS to access it.
TOKENS can be obtained with `oauth2-auth'."
(let (tokens-need-renew)
@@ -187,10 +187,14 @@ TOKENS can be obtained with `oauth2-auth'."
;; This is to make `url' think
;; it's done.
(setq success t)))
- (let ((url-buffer (url-retrieve-synchronously
- (oauth2-url-append-access-token token url))))
+ (let ((url-request-method request-method)
+ (url-request-data request-data)
+ (url-request-extra-headers request-extra-headers)
+ (url-buffer))
+ (setq url-buffer (url-retrieve-synchronously
+ (oauth2-url-append-access-token token url)))
(if tokens-need-renew
- (oauth2-url-retrieve-synchronously (oauth2-refresh-access token) url)
+ (oauth2-url-retrieve-synchronously (oauth2-refresh-access token) url request-method request-data request-extra-headers)
url-buffer)))))
(provide 'oauth2)