federicotdn / verb

Organize and send HTTP requests from Emacs
https://melpa.org/#/verb
GNU General Public License v3.0
545 stars 20 forks source link

[ob-verb] Request body including multibyte characters cause error #14

Closed kamoii closed 4 years ago

kamoii commented 4 years ago

Trying to send a request which includes multibyte characters with ob-verb causes error.

#+begin_src verb
template http://localhost:3000/api
Accept: application/json
Content-Type: application/json; charset=utf-8
#+end_src

#+begin_src verb :wrap src ob-verb-response :op send get-body
post /officer/basic_info/90000000

{ test: "日本語" }
#+end_src

Following message is outputed to *Messages*.

POST request sent to http://localhost:3000/api/officer/basic_info/90000000
url-http-create-request: Multibyte text in HTTP request: POST /api/officer/basic_info/90000000 HTTP/1.1
MIME-Version: 1.0
Connection: keep-alive
Extension: Security/Digest Security/SSL
Host: localhost:3000
Accept-encoding: gzip
Accept: application/json
Content-Type: application/json; charset=utf-8
Content-length: 21

{ test: "日本語" }
federicotdn commented 4 years ago

Hi @kamoii, thanks for reporting this. I've managed to reproduce it locally and will look into it.

federicotdn commented 4 years ago

Interesting: if I remove the Accept header, it appears to work

federicotdn commented 4 years ago

I've pushed a fix to master, please check if it works for you when the next MELPA build picks it up.

kamoii commented 4 years ago

@federicotdn Thank you! Installed the latest version, and it works!