I have a login that needs an email and password.
If I hit it from Postman rest client with this:
www.site.com/login.json?session[email]=bob@gmail.com&session[password]=password
The server (Rails) will read it just fine, like this:
{"session"=>{"email"=>"bob@gmail.com", "password"=>"password"}, "action"=>"create", "controller"=>"sessions", "format"=>"json"}
But, if I send in the same thing with HTTPGet from android, like this:
HttpClient httpclient = new DefaultHttpClient();
//get the parameters
String email = params[0];
String password = params[1];
String url = "http://www.site.com/login.json?session[email]=" + email + "?session[password]=" + password;
HttpGet httpget = new HttpGet(url);
httpget.setHeader("Accept", "application/json");
httpget.setHeader("Content-type", "application/json");
response = httpclient.execute(httpget);
The server doesn't recognize the parameters, and I end up with an empty json object like this:
{"session"=>{}, "action"=>"create", "controller"=>"sessions", "format"=>"json"}
Anybody know how to form the parameters in this HTTPGet call in android to work like it will in a the rest client call? Thanks!