Closed dangom closed 4 years ago
(request--urlencode-alist '(("filter[stop]"
. "North+Station")))
So your goal is to avoid yielding "filter%5Bstop%5D=North%2BStation"
I cannot currently reconcile your goal with this SO reply suggesting such special characters need to be hexified.
https://stackoverflow.com/questions/1455578/characters-allowed-in-get-parameter
Thanks for the quick reply. Trying to translate the following call to request.el:
(let (result)
(request
"https://api-v3.mbta.com/schedules" :params '(("filter[stop]"
. "North Station")
("filter[direction_id]" . "0") ("sort"
. "-arrival_time") ("filter[min_time]" . "18:00"))
:sync t :parser 'json-read :success (cl-function
(lambda (&key data &allow-other-keys)
(setq result
(mapcar (lambda (x) (alist-get 'id (append x
nil)))
(alist-get 'data data))))))
result)
If I set params to
("filter[stop]" . "North+Station")
, then the characters[
and]
get hexified and the request fails. Is there a way to temporarily allow these characters in a let form?Example: