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

Issue running 1.0.0 on Python 3 (resolved by installing http-prompt under Python 2)

Open vergenzt opened this issue 5 years ago • 1 comments

would like to add more detail, but don't have time to at the moment so here's the tl;dw (too long, didn't write):

  • my Mac system has Python 3 installed via homebrew
  • I pip3 install'd http-prompt (version 1.0.0)
  • http-prompt was starting up fine, but wasn't respecting a --form flag in my env -- it respected cd and -v flags for some reason though. 🤔
  • I tried a number of things, but eventually it worked when I brew tapped and installed a python@2 version (as it's no longer supported in official homebrew) and pip install'd from there.

Just figured I'd let you know! I'm guessing it works fine on latest master - if so, could you cut a new release?

vergenzt avatar Oct 09 '20 15:10 vergenzt

hi,

I think I've the same problem.

I don't think it's a Python interpreter problem (2 vs 3).

when using option --form (or -f), httpie post is displaying the good command but is sending a bad request with Content-Type: application/json. :-1:

http://127.0.0.1:8000> env
--form
cd http://127.0.0.1:8000
name=value

http://127.0.0.1:8000> httpie post
http --form POST http://127.0.0.1:8000 name=value

http://127.0.0.1:8000> post
POST / HTTP/1.1
Host: 127.0.0.1:8000
User-Agent: HTTPie/2.2.0
Accept-Encoding: gzip, deflate
Accept: application/json, */*;q=0.5
Connection: keep-alive
Content-Type: application/json
Content-Length: 17

{"name": "value"}

when using double option --form (or double -f or mixed --form and -f), http-prompt is sending a good request with Content-Type: application/x-www-form-urlencoded; charset=utf-8. :+1:

http://127.0.0.1:8000> env
--form
-f
cd http://127.0.0.1:8000
name=value

http://127.0.0.1:8000> httpie post
http --form -f POST http://127.0.0.1:8000 name=value

http://127.0.0.1:8000> post
POST / HTTP/1.1
Host: 127.0.0.1:8000
User-Agent: HTTPie/2.2.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Content-Length: 10

name=value

regards.

patatetom avatar Oct 24 '20 21:10 patatetom