From e91facdb643a6a340207c51f648565fcfcb029d3 Mon Sep 17 00:00:00 2001 From: Johnson Denen Date: Fri, 7 Apr 2017 09:23:05 -0400 Subject: Add optional headers to POST method --- mastodon.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mastodon.el b/mastodon.el index a200b79..26c6769 100644 --- a/mastodon.el +++ b/mastodon.el @@ -63,13 +63,13 @@ "Returns Mastondon API URL for ENDPOINT." (concat mastodon-instance-url "/api/" mastodon--api-version "/" endpoint)) -(defun mastodon--http-post (url callback args) +(defun mastodon--http-post (url callback args &optional headers) "Sends ARGS to URL as a POST request. Response buffer is passed to the CALLBACK function." (let ((url-request-method "POST") (url-request-extra-headers - '(("Content-Type" . "application/x-www-form-urlencoded"))) + (append '(("Content-Type" . "application/x-www-form-urlencoded")) headers)) (url-request-data (mapconcat (lambda (arg) (concat (url-hexify-string (car arg)) -- cgit v1.2.3