Skip to content

Instantly share code, notes, and snippets.

@Jaymo
Created June 16, 2014 08:51
Show Gist options
  • Save Jaymo/c010ee1da79e44cb5efa to your computer and use it in GitHub Desktop.
Save Jaymo/c010ee1da79e44cb5efa to your computer and use it in GitHub Desktop.
Volley: passing parameters in a string request
StringRequest loginReq = new StringRequest(Method.GET,
URL, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
respnse=response;
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
respnse="-1";
}
}){
@Override
protected Map<String, String> getParams() {
Map<String, String> params = new HashMap<String, String>();
params.put("type","register");
params.put("name",fname+" "+lname);
params.put("number",phone);
params.put("password",pass);
return params;
}
};
PesaBoxApplication.getInstance().addToRequestQueue(loginReq, tag_signupReq);
return respnse;
@Henriquedn
Copy link

Hi, String object was helpful. I cant get volley to pick up parameters from getParams.

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