diff options
author | Johnson Denen <johnson.denen@gmail.com> | 2017-04-07 09:23:05 -0400 |
---|---|---|
committer | jdenen <Johnson.Denen@ascenaretail.com> | 2017-04-09 08:53:07 -0400 |
commit | e91facdb643a6a340207c51f648565fcfcb029d3 (patch) | |
tree | 46534b49065c203fd6a91ef7272e555b6214201a | |
parent | b3563c416b608513ae2b096b1a70de8ce763ccc3 (diff) |
Add optional headers to POST method
-rw-r--r-- | mastodon.el | 4 |
1 files 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)) |