tkf / emacs-request

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

fixes issue with missing mime-types #211

Closed rfaulhaber closed 1 year ago

rfaulhaber commented 1 year ago

Found an issue with request where it was ignoring the value of :mime-type when specified.

For example, this:

(request-response-data
 (request "http://httpbin.org/post"
   :type "POST"
   :files `(("test" . ("file" :file "/home/ryan/hello.txt" :mime-type "text/plain")))
   :parser 'json-read
   :success (cl-function
             (lambda (&key data &allow-other-keys)
               (message "data %s" data)))))

would generate a --form flag like: test=@/home/ryan/hello.txt;filename=file. This patch fixes the code such that type=... is added.

dickmao commented 1 year ago

[my best denzel impression] "My man..."