aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-http.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-11-15 11:28:30 +0100
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-11-16 10:01:45 +0100
commitc3e1c3403f8a308894f5c335b4a060def85b4d4d (patch)
tree43a7e00abdf8a53daa961de0c5088621377e13eb /lisp/mastodon-http.el
parent2197fa013ec02cd82750a319c1c314fdb4a7c2a4 (diff)
add delete and edit lists
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.