diff options
author | Johnson Denen <johnson.denen@gmail.com> | 2017-04-20 11:41:41 -0400 |
---|---|---|
committer | Johnson Denen <johnson.denen@gmail.com> | 2017-04-20 12:30:02 -0400 |
commit | df6320f5174e610f1eb281ff619fd88a5fb1ba6a (patch) | |
tree | 2735f2289ae25436ea6172c38cfa590fce8cd5de /lisp/mastodon-http.el | |
parent | 9a705f3884168bf9ac0708b64f333b3893f0d0d8 (diff) |
Close #11 with new callbacks
Diffstat (limited to 'lisp/mastodon-http.el')
-rw-r--r-- | lisp/mastodon-http.el | 7 |
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. |