Closed ShuguangSun closed 5 years ago
Are you calling (request 'http://www.the.url)
instead of (request "http://www.the.url")
?
If not, it would be nice to have your original request call that produces the error.
For example
(request
"http://httpbin.org/get"
:params '(("key" . "value") ("key2" . "value2"))
:parser 'json-read
:success (cl-function
(lambda (&key data &allow-other-keys)
(message "I sent: %S" (assoc-default 'args data)))))
Below is my Emacs information.
In GNU Emacs 27.0.50 (build 3, x86_64-w64-mingw32)
of 2019-07-28 built on
Repository revision: efc6301068b53ab319aa6a8a1b5607273e4d5b17
Repository branch: master
Windowing system distributor 'Microsoft Corp.', version 10.0.17763
System Description: Microsoft Windows 10 Enterprise (v10.0.1809.17763.615)
It's a mystery. Can you isolate the latest request.el into /tmp and execute the following:
emacs-27.0.50 -Q --batch -l /tmp/request.el --eval "(request \"http://httpbin.org/get\" :sync t :params '((\"key\" . \"value\") (\"key2\" . \"value2\")) :parser 'json-read :success (cl-function (lambda (&key data &allow-other-keys) (message \"I sent: %S\" (assoc-default 'args data)))))"
In Eamcs -Q, it is only
REQUEST [error] Error (error) while connecting to http://httpbin.org/get.
(print (type-of (request-response-url response)))
will print symbol
I set the log and message to trace, it shows that the first several steps success and get the data, however the callback raise the error.
I don't know at what point (request-response-url response)
changes from a string to a symbol, so in f466ab1 merely avoid the curl-file-p
check if it's a symbol. Sorry about this.
It seems the (setf (request-response-url response) url-effective)
in request--curl-callback
changes the type, and the url-effective
is a symbol.
Indeed, this is not something I tested. Thank you for your help.
When I updated to the newest request from melpla, it raise the error message:
When I revised the following changes recently, it comes back to work again. So that I think the changes below is not robust.