restclient.el
restclient.el copied to clipboard
POST to https endpoint fails?
Hello, I am trying to POST JSON to an API I'm writing. Making curl requests works fine but I'm getting these errors from restclient.el
Request
POST https://www.example.com/
Content-Type: application/json
{
"email": "[email protected]",
"password": "secretP@55word"
}
Messages buffer output
Contacting host: **API URL**:443
Opening TLS connection to `**API URL**'...
Opening TLS connection with `gnutls-cli --insecure -p 443 **API URL**'...failed
Opening TLS connection with `gnutls-cli --insecure -p 443 **API URL** --protocols ssl3'...failed
Opening TLS connection with `openssl s_client -connect **API URL**:443 -no_ssl2 -ign_eof'...failed
Opening TLS connection to `**API URL**'...failed
url-http: Could not create connection to **API URL**:443
gnutls-cli version
$ /usr/local/bin/gnutls-cli --version
gnutls-cli 3.3.9
cc @pashky
...and your point is? It works for me and, I guess, many others. I've never tried it with external command though, I always compile gnutls in and don't see why you wouldn't. Or at least add /usr/local/bin to $PATH.
@pashky just wondering if you had seen that error before. I'll give the /usr/local/bin thing a shot.
I use the builds from Emacs for Mac OS X which I guess don't have gnutls compiled in by default. Maybe that'll help me out.
@bitops highly recommend brew install emacs --HEAD --use-git-head --with-cocoa --with-gnutls --with-rsvg --with-imagemagick vs. Emacs for OSX.
You can choose to ommit the --HEAD --user-git-head stuff but I don't and it has historically been stable for me.
@localredhead is it just the same as Emacs for OSX in terms of the UI? I'm attached to my current setup. :smile_cat:
@bitops I cannot say for certain without trying.
To my knowledge emacs in GUI mode will be the same because EmacsForOSX is supposed to be a VANILLA install of emacs without any extra bells and whistles.
You should feel free to use the brew version - which has the benefit of being built for your machine when you brew install it. Another added benefit of this is that you get a proper version of emacs to run in the terminal and also in GUI. The caveat is you have to unlink the OS supplied version of emacs (which is OOOOOLD). Personally I just delete the OSX supplied version and move the /bin out of the way. Then when I brew install emacs with the command I give you it will build, install, and Link emacs appropriately.
Let me know if you have trouble with it. [email protected] - I can answer questions you might have.
@localredhead thank you! I'll let you know if I have trouble.
I am also hitting this same error. I've tried brew install emacs --HEAD --use-git-head --with-cocoa --with-gnutls --with-rsvg --with-imagemagick to no avail. When I copy as curl my request works.
Any known steps to debug this issue?
I'm having the same problem, too. I've been using this module for months... and then, all the sudden, it stopped working. I'm guessing a recent commit to trunk broke it.
Guys, would learn how to unix already or switch to Atom, please? Or Notepad++ even, if you can't set PATH properly.
I hear good things about Notepad++
@pashky I don't understand–what do you mean "learn how to unix already"? The error is extremely unhelpful and doesn't even remotely point me in the right debugging direction.
Try to eval (url-retrieve-synchronously "https://www.example.com").
If it fails, it is not problem of restclient.el, but probably environment problem.
exec-path-from-shell might help if you use macOS.