diff options
author | mousebot <mousebot@riseup.net> | 2021-10-23 12:22:39 +0200 |
---|---|---|
committer | mousebot <mousebot@riseup.net> | 2021-10-23 12:22:39 +0200 |
commit | 67e515edbbaa660757ecdcf87bbdfe353eb652f2 (patch) | |
tree | ac713d734ba22b97f766dea4c89738fd23e9e545 /lisp/mastodon-http.el | |
parent | 21e22bea31da362e3673cbcc4a7ccd3fe67149ed (diff) |
move read-file-as-string
Diffstat (limited to 'lisp/mastodon-http.el')
-rw-r--r-- | lisp/mastodon-http.el | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index 95e8bf5..4f4cc3f 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -90,6 +90,12 @@ Message status and JSON error from RESPONSE if unsuccessful." (let ((json-response (mastodon-http--process-json))) (message "Error %s: %s" status (cdr (assoc 'error json-response)))))))) +(defun mastodon-http--read-file-as-string (filename) + "Read a file FILENAME as a string. Used to generate image preview." + (with-temp-buffer + (insert-file-contents filename) + (string-to-unibyte (buffer-string)))) + (defun mastodon-http--post (url args headers &optional unauthenticed-p) "POST synchronously to URL with ARGS and HEADERS. @@ -113,12 +119,6 @@ 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) - "Read a file FILENAME as a string. Used to generate image preview." - (with-temp-buffer - (insert-file-contents filename) - (string-to-unibyte (buffer-string)))) - (defun mastodon-http--get (url) "Make synchronous GET request to URL. |