aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mastodon-http.el22
1 files changed, 11 insertions, 11 deletions
diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el
index 3b31668..462b5c6 100644
--- a/lisp/mastodon-http.el
+++ b/lisp/mastodon-http.el
@@ -101,7 +101,7 @@ Authorization header is included by default unless UNAUTHENTICED-P is non-nil."
(url-retrieve-synchronously url nil nil mastodon-http--timeout)))))
(defun mastodon-http--get (url)
- "Make GET request to URL.
+ "Make synchronous GET request to URL.
Pass response buffer to CALLBACK function."
(let ((url-request-method "GET")
@@ -112,17 +112,8 @@ Pass response buffer to CALLBACK function."
(url-retrieve-synchronously url)
(url-retrieve-synchronously url nil nil mastodon-http--timeout))))
-(defun mastodon-http--delete (url)
- "Make DELETE request to URL."
- (let ((url-request-method "DELETE")
- (url-request-extra-headers
- `(("Authorization" . ,(concat "Bearer "
- (mastodon-auth--access-token))))))
- (with-temp-buffer
- (url-retrieve-synchronously url))))
-
(defun mastodon-http--get-json (url)
- "Make GET request to URL. Return JSON response."
+ "Make synchronous GET request to URL. Return JSON response."
(with-current-buffer (mastodon-http--get url)
(mastodon-http--process-json)))
@@ -137,6 +128,15 @@ Pass response buffer to CALLBACK function."
(kill-buffer)
(json-read-from-string json-string)))
+(defun mastodon-http--delete (url)
+ "Make DELETE request to URL."
+ (let ((url-request-method "DELETE")
+ (url-request-extra-headers
+ `(("Authorization" . ,(concat "Bearer "
+ (mastodon-auth--access-token))))))
+ (with-temp-buffer
+ (url-retrieve-synchronously url))))
+
;; http functions for search:
(defun mastodon-http--process-json-search ()
"Process JSON returned by a search query to the server."