aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-http.el
diff options
context:
space:
mode:
authorJohnson Denen <johnson.denen@gmail.com>2017-04-20 11:41:41 -0400
committerJohnson Denen <johnson.denen@gmail.com>2017-04-20 12:30:02 -0400
commitdf6320f5174e610f1eb281ff619fd88a5fb1ba6a (patch)
tree2735f2289ae25436ea6172c38cfa590fce8cd5de /lisp/mastodon-http.el
parent9a705f3884168bf9ac0708b64f333b3893f0d0d8 (diff)
Close #11 with new callbacks
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.