Closed karthic891 closed 5 years ago
(require 'request)
(require 'json)
(defun get-something (key value extra-param)
(request
"http://httpbin.org/get"
:parser 'json-read
:params `((,key . ,value))
:success (apply-partially
(cl-function
(lambda (extra-param &key data &allow-other-keys)
(message "Got %s with callback parameterized by %s"
(alist-get 'args data) extra-param)))
extra-param)))
(get-something "e" "mc^2" "extra")
Perfect! Thank you.
Is there any way to pass parameters to the callbacks that we pass to 'success', 'error', 'status-code'?
For instance, is there a way to pass extra-param to the success' callback?