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 query strings get encoded as + plus signs instead of %20 #796

jamesdaily opened this Issue Nov 20, 2017 · 1 comment


None yet
2 participants

jamesdaily commented Nov 20, 2017

In the Java client, when producing a URL, space characters in query strings get encoded as + plus signs instead of %20.

For example a search for address "123 main street" would produce a URL such as:

This is correct for application/x-www-form-urlencoded, but for non-forms based applications, it should just be RFC 3986 which uses %20 instead of + signs for spaces within query strings values.

Is it possible to configure this to use %20 instead:

It looks like the code responsible for the + signs is the URLEncoder.encode call here in

private boolean addQueryParameter(StringBuilder b, boolean first, String nextKey, String nextValue) {
		boolean retVal = first;
		if (retVal) {
			retVal = false;
		} else {
		try {
			b.append(URLEncoder.encode(nextKey, "UTF-8"));
			b.append(URLEncoder.encode(nextValue, "UTF-8"));
		} catch (UnsupportedEncodingException e) {
			throw new ConfigurationException("Could not find UTF-8 encoding. This shouldn't happen.", e);
		return retVal;

This comment has been minimized.


jamesagnew commented Nov 25, 2017

Thanks for reporting! Fix incoming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment