aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-http.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mastodon-http.el')
-rw-r--r--lisp/mastodon-http.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el
index 106c76b..843afc1 100644
--- a/lisp/mastodon-http.el
+++ b/lisp/mastodon-http.el
@@ -216,6 +216,22 @@ Callback to `mastodon-http--get-response-async', usually
(with-temp-buffer
(mastodon-http--url-retrieve-synchronously url)))))
+(defun mastodon-http--put (url &optional args headers)
+ "Make PUT request to URL."
+ (mastodon-http--authorized-request
+ "PUT"
+ (let ((url-request-data
+ (when args
+ (mastodon-http--build-query-string args)))
+ (url-request-extra-headers
+ (append url-request-extra-headers ; auth set in macro
+ ;; pleroma compat:
+ (unless (assoc "Content-Type" headers)
+ '(("Content-Type" . "application/x-www-form-urlencoded")))
+ headers)))
+ (with-temp-buffer
+ (mastodon-http--url-retrieve-synchronously url)))))
+
(defun mastodon-http--append-query-string (url params)
"Append PARAMS to URL as query strings and return it.