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

Cannot skip url encode! #71

Closed
liveresume opened this issue Oct 13, 2016 · 1 comment
Closed

Cannot skip url encode! #71

liveresume opened this issue Oct 13, 2016 · 1 comment

Comments

@liveresume
Copy link

liveresume commented Oct 13, 2016

LinkedIn requires parenthesis to indicate parameters to return. OAuth2 encodes parenthesis to %28 and %29 which results in an error from LinkedIn. I found this code but it does not work. Why?

  def skip_url_encode_option, do: [hackney: [path_encode_fun: fn a -> a end]]

  def get_user_id!(client) do
    response = OAuth2.Client.get!(client, "/v1/people/~:(id)?format=json", [], skip_url_encode_option)
  end
@fajarmf
Copy link

fajarmf commented Oct 20, 2016

I believe since we are directly using hackney from version 0.6, your skip_url_encode_option should be modified into:

  defp skip_url_encode_option, do: [path_encode_fun: fn(a) -> a end]

the original hackney: was required by httpoison that is not used anymore.

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

3 participants