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

fixes issue with missing mime-types #211

Closed rfaulhaber closed 2 years ago

rfaulhaber commented 2 years 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 2 years ago

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