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

Spaces in url string are not being encoded by hackney #152

Open
jeramyRR opened this issue Jun 28, 2016 · 3 comments
Open

Spaces in url string are not being encoded by hackney #152

jeramyRR opened this issue Jun 28, 2016 · 3 comments

Comments

@jeramyRR
Copy link

Spaces in a url string should be converted to %20 when calling HTTPoison.get, but it appears that this is not happening.

example:
HTTPoison.get "http://api.openweathermap.org/data/2.5/weather?q=London, UK"
should convert url to:
http://api.openweathermap.org/data/2.5/weather?q=London,%20UK

@ryanwinchester
Copy link
Contributor

ryanwinchester commented Oct 15, 2018

This should encode properly if you do it like

HTTPoison.get(
  "http://api.openweathermap.org/data/2.5/weather",
  [],
  params: %{q: "London, UK"}
)

@gushonorato
Copy link
Contributor

@ryanwinchester this doesn't solve the case when HTTPoison follows a redirect with an URL with spaces in Location header. This issue seems simple to solve but it's open for 2 years. Also, there's a pull request open that resolves this issue since 2016. Can I do something to help?

@kamaroly
Copy link

kamaroly commented Feb 9, 2023

Thanks @ryanwinchester . Your solution worked well for me.

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

4 participants