http-prompt icon indicating copy to clipboard operation
http-prompt copied to clipboard

Content-Type:application/x-www-form-urlencoded is ignored.

Open xoss opened this issue 5 years ago • 0 comments

Hello everyone. It seems for me, that http-prompt somehow ignores Content-Type: application/x-www-form-urlencoded. Even though httpie preview returns the right command

http --form --proxy=https://localhost:9999 --verbose --verify=no http://example.com password=bar username=foo Content-Type:application/x-www-form-urlencoded

the actual request treats the body to be json

http://example.com> post
POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 38
Content-Type: application/x-www-form-urlencoded
Host: example.com
User-Agent: HTTPie/2.0.0

{"password": "bar", "username": "foo"}

Whereas, when running the httpie command directly on the shell, it's interpreted correctly

$ http --form --proxy=https://localhost:9999 --verbose --verify=no http://example.com password=bar username=foo Content-Type:application/x-www-form-urlencoded                                                                                                  
POST / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 25
Content-Type: application/x-www-form-urlencoded
Host: example.com
User-Agent: HTTPie/2.0.0

password=bar&username=foo

Has someone experienced this issue so far as well? Was browsing the reported issues, but couldn't find something related.

xoss avatar Feb 27 '20 16:02 xoss