aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormousebot <mousebot@riseup.net>2021-10-21 19:00:14 +0200
committermousebot <mousebot@riseup.net>2021-10-21 19:00:14 +0200
commit45390f6ad1923814a3ac28fc456fd264a8b8cd1e (patch)
treedce1710bc3597750a03e87baf4461b8ca22319c5
parent2329c3a7fc7ab4beb8caaeaedfa2b17ea4cf1db2 (diff)
restore hdurer's http--read-file-as-string
-rw-r--r--lisp/mastodon-http.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el
index fbcf855..6df2aab 100644
--- a/lisp/mastodon-http.el
+++ b/lisp/mastodon-http.el
@@ -113,6 +113,12 @@ Authorization header is included by default unless UNAUTHENTICED-P is non-nil."
(url-retrieve-synchronously url)
(url-retrieve-synchronously url nil nil mastodon-http--timeout)))))
+(defun mastodon-http--read-file-as-string (filename)
+ ""
+ (with-temp-buffer
+ (insert-file-contents filename)
+ (string-to-unibyte (buffer-string))))
+
(defun mastodon-http--get (url)
"Make synchronous GET request to URL.