diff options
author | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2022-11-05 17:21:13 +0100 |
---|---|---|
committer | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2022-11-05 17:21:13 +0100 |
commit | 5613c11e037ceb1d9beab26a48f2958c669ea029 (patch) | |
tree | 385ad25fb8a69e7277bd1e9fdd31180390461e3e /lisp/mastodon-http.el | |
parent | f678fc83f777ef40e948c176b1343e4de3764856 (diff) | |
parent | 8f5cb76677836703f0b554fe5ab669ba1e9d6d91 (diff) |
Merge branch 'develop'
Diffstat (limited to 'lisp/mastodon-http.el')
-rw-r--r-- | lisp/mastodon-http.el | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index f73fd6b..e3efabe 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -74,7 +74,8 @@ This is a thin abstraction over the system `url-retrieve-synchronously'. Depending on which version of this -is available we will call it with or without a timeout." +is available we will call it with or without a timeout. +SILENT means don't message." (if (< (cdr (func-arity 'url-retrieve-synchronously)) 4) (url-retrieve-synchronously url) (url-retrieve-synchronously url (or silent nil) nil mastodon-http--timeout))) @@ -141,14 +142,15 @@ Authorization header is included by default unless UNAUTHENTICATED-P is non-nil. (defun mastodon-http--get (url &optional silent) "Make synchronous GET request to URL. - -Pass response buffer to CALLBACK function." +Pass response buffer to CALLBACK function. +SILENT means don't message." (mastodon-http--authorized-request "GET" (mastodon-http--url-retrieve-synchronously url silent))) (defun mastodon-http--get-json (url &optional silent) - "Make synchronous GET request to URL. Return JSON response." + "Make synchronous GET request to URL. Return JSON response. +SILENT means don't message." (with-current-buffer (mastodon-http--get url silent) (mastodon-http--process-json))) @@ -194,7 +196,8 @@ PARAMS should be an alist as required by `url-build-query-string'." (defun mastodon-http--get-search-json (url query &optional param silent) "Make GET request to URL, searching for QUERY and return JSON response. -PARAM is any extra parameters to send with the request." +PARAM is any extra parameters to send with the request. +SILENT means don't message." (let ((buffer (mastodon-http--get-search url query param silent))) (with-current-buffer buffer (mastodon-http--process-json-search)))) @@ -202,7 +205,8 @@ PARAM is any extra parameters to send with the request." (defun mastodon-http--get-search (base-url query &optional param silent) "Make GET request to BASE-URL, searching for QUERY. Pass response buffer to CALLBACK function. -PARAM is a formatted request parameter, eg 'following=true'." +PARAM is a formatted request parameter, eg 'following=true'. +SILENT means don't message." (mastodon-http--authorized-request "GET" (let ((url (if param |