emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/oauth2 ba35131 05/23: oauth2: allow to use any HTTP req


From: Stefan Monnier
Subject: [elpa] externals/oauth2 ba35131 05/23: oauth2: allow to use any HTTP request type
Date: Tue, 1 Dec 2020 16:31:58 -0500 (EST)

branch: externals/oauth2
commit ba351311567dfb0134eb370f1eaa68fb4c0576b5
Author: Julien Danjou <julien@danjou.info>
Commit: Julien Danjou <julien@danjou.info>

    oauth2: allow to use any HTTP request type
    
    * oauth2: allow to use any HTTP request type
---
 oauth2.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/oauth2.el b/oauth2.el
index 3b57c05..7175606 100644
--- a/oauth2.el
+++ b/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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]