Hi,
I am getting some weird errors with my Android App. It appears that this code is double encoding the JSON string. What should be sent is ?{"email":"
[email protected]","password":"
asdf"}
or
?%7B%22email%22:%22.....
what the server is seeing is %257B%2522email%2522:%2522 ....
which means the server sees %7B%22email%22:%22 .....
This confuses the server.
Any ideas why this is happening?
Thanks for your help
Code:
DefaultHttpClient c = new DefaultHttpClient();
if(cookies!=null)
c.setCookieStore(cookies);
if(loginNotLogout){
jso.put("email", userData.email);
jso.put("password", userData.password);
}
URI u = null;
if(loginNotLogout)
u= new URI("HTTP","www.website.com","/UserService",jso.toString(),"");
else
u= new URI("HTTP","www.website.com","/UserService",jso.toString(),"");
HttpGet httpget = new HttpGet(u);
HttpResponse response = c.execute(httpget);
ret.jsonString = EntityUtils.toString(response.getEntity());