tkf / emacs-request

Request.el -- Easy HTTP request for Emacs Lisp
http://tkf.github.com/emacs-request/
GNU General Public License v3.0
629 stars 93 forks source link

Incorrect flags passed to curl with :auth #187

Closed DavidTruby closed 4 years ago

DavidTruby commented 4 years ago

When I try use the :auth option, the code following it gets passed to curl verbatim so the curl call fails. For example:

(request
   "https://example.com"
   :type "POST"
   :data `(("data" . "some_data"))
   :auth '(:user "truby"))

passes the flag --(:user "truby") to curl, which it doesn't understand.

dickmao commented 4 years ago

:auth needs to be one of basic, digest, anyauth, i.e., one of the various curl authentication flags.

I've only ever tested digest so it's not clear how well some of the other methods work.

DavidTruby commented 4 years ago

Oh ok! It wasn't clear to me from reading the PR that introduced it that that was the case (I was following the example given in the PR). Some documentation of how this flag works would be great, and maybe a warning if the flag is wrong? I can look at doing that if it's a PR you'd be interested in :)

dickmao commented 4 years ago

You got it. d02d134

DavidTruby commented 4 years ago

Wow, that was fast, thanks!