Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
vergenzt opened this issue Oct 9, 2020 · 1 comment

Comments

@vergenzt
Copy link

vergenzt commented Oct 9, 2020

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?

@patatetom
Copy link

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. 👎

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. 👍

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants