branch: elpa/fedi
commit 1409a667c52dc224f07f807f09f010882fdc4bec
Author: marty hiatt <[email protected]>
Commit: marty hiatt <[email protected]>

    http: POST - add default Content-Type header if not JSON.
---
 fedi-http.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/fedi-http.el b/fedi-http.el
index 5e0d6ef1c0d..8afd4de1b4a 100644
--- a/fedi-http.el
+++ b/fedi-http.el
@@ -162,10 +162,11 @@ json-string PARAMS."
               (fedi-http--build-params-string params))))
          ;; TODO: perhaps leave these headers to the package now that
          ;; `fedi-request' takes header args?
-         (headers (when json
-                    (append headers
-                            '(("Content-Type" . "application/json")
-                              ("Accept" . "application/json")))))
+         (headers (if json
+                      (append headers
+                              '(("Content-Type" . "application/json")
+                                ("Accept" . "application/json")))
+                    '(("Content-Type" . "application/x-www-form-urlencoded"))))
          (url-request-extra-headers
           (append url-request-extra-headers ; set in macro
                   headers)))

Reply via email to