aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-http.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mastodon-http.el')
-rw-r--r--lisp/mastodon-http.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el
index 50b560f..92c876f 100644
--- a/lisp/mastodon-http.el
+++ b/lisp/mastodon-http.el
@@ -108,6 +108,13 @@ If response code is not 2XX, switches to the response buffer created by `url-ret
(funcall success)
(switch-to-buffer (current-buffer))))
+(defun mastodon-http--triage (response success)
+ (let ((status (with-current-buffer response
+ (mastodon--response-code))))
+ (if (string-prefix-p "2" status)
+ (funcall success)
+ (switch-to-buffer response))))
+
(defun mastodon-http--post (url args headers)
"POST synchronously to URL with ARGS and HEADERS.