I discovered that URLEncodedUtils.format() encodes spaces as “+” but not %20
When i pass in parameter NameValuePairs consisting of value with space it encodes spaces as + signs.
I passed a “time” key with “2011-05-08 21:36:39” value and
URLEncodedUtils.format(nameValuePairs, “UTF-8”);
returns
&time=2011-05-08+21%3A36%3A39&
where as u can c the space replaced with “+” instead of %20
Why is that? Didn’t expect it. Thought space could be encoded exclusively as %20 but not the +…
I discovered that URLEncodedUtils.format() encodes spaces as + but not %20 When i pass
Share
Copy/paste from http://www.w3schools.com/TAGS/ref_urlencode.asp
URLs cannot contain spaces. URL encoding normally replaces a space with a + sign.