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

@QueryName doesn't encode "/" (slash) to %2F #2384

Closed
ildar2 opened this issue Jul 1, 2017 · 2 comments
Closed

@QueryName doesn't encode "/" (slash) to %2F #2384

ildar2 opened this issue Jul 1, 2017 · 2 comments

Comments

@ildar2
Copy link

ildar2 commented Jul 1, 2017

I have a string:
FGgOzxaG07UTP0T39t71IDCJFzwyj9QaiofNK3M5ZGr0tgpVOXWVI3N3Yz4JSTWktle+MMukcV/znss5qORMWQ==
it should look like this in url:
FGgOzxaG07UTP0T39t71IDCJFzwyj9QaiofNK3M5ZGr0tgpVOXWVI3N3Yz4JSTWktle%2BMMukcV%2Fznss5qORMWQ%3D%3D
instead it looks like this:
FGgOzxaG07UTP0T39t71IDCJFzwyj9QaiofNK3M5ZGr0tgpVOXWVI3N3Yz4JSTWktle%2BMMukcV/znss5qORMWQ%3D%3D

while "+" and "=" get encoded properly, "/" doesn't

this means, i can't use api, which uses encoded xml strings

I guess, I should encode it manually and use (encoded = true) property, right?

@JakeWharton
Copy link
Member

JakeWharton commented Jul 1, 2017 via email

@liushuai42
Copy link

liushuai42 commented Dec 19, 2017

The server in our company can't accept the "/" char in query value, so I have to use addEncodedQueryParameter in a commonParams Interceptor

import java.net.URLEncoder;

  String token = getToken();
  commonParams.addEncodedQueryParameter(KEY_TOKEN, URLEncoder.encode(token, "UTF-8"));

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