diff options
| author | marty hiatt <martianhiatus@riseup.net> | 2024-05-29 15:37:35 +0200 | 
|---|---|---|
| committer | marty hiatt <martianhiatus@riseup.net> | 2024-05-29 15:37:35 +0200 | 
| commit | 9d043ea3fbb8f2b8d162329b570a84f4790fc6f6 (patch) | |
| tree | c4ab90d9b24ff24ac2a6c59c83f4afbb940da0d9 /lisp/mastodon-http.el | |
| parent | 87dfd9bd20692475a9ffa783566a74ef21525835 (diff) | |
unfilter langs: POST raw params and it works!
Diffstat (limited to 'lisp/mastodon-http.el')
| -rw-r--r-- | lisp/mastodon-http.el | 16 | 
1 files changed, 11 insertions, 5 deletions
diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index 5065ee5..4721087 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -141,14 +141,20 @@ Used for API form data parameters that take an array."                              &optional params headers unauthenticated-p json)    "POST synchronously to URL, optionally with PARAMS and HEADERS.  Authorization header is included by default unless -UNAUTHENTICATED-P is non-nil. If JSON, encode PARAMS as JSON for -the request data." +UNAUTHENTICATED-P is non-nil. + +If JSON is :json, encode PARAMS as JSON for +the request data. If it is :raw, just use the plain params."    (mastodon-http--authorized-request "POST"      (let* ((url-request-data              (when params -              (if json -                  (json-encode params) -                (mastodon-http--build-params-string params)))) +              (cond ((eq json :json) +                     (json-encode +                      params)) +                    ((eq json :raw) +                     params) +                    (t +                     (mastodon-http--build-params-string params)))))             (url-request-extra-headers              (append url-request-extra-headers ; auth set in macro                      (unless (assoc "Content-Type" headers) ; pleroma compat:  | 
