Skip to content

Instantly share code, notes, and snippets.

@andersonqi
Last active December 2, 2015 20:09
Show Gist options
  • Save andersonqi/b2c948adf7f82f9ef9d8 to your computer and use it in GitHub Desktop.
Save andersonqi/b2c948adf7f82f9ef9d8 to your computer and use it in GitHub Desktop.
Volley Post Request
String url = "";
final StringRequest postRequest = new StringRequest(Request.Method.POST, url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
error.printStackTrace();
}
}
) {
@Override
protected Map<String, String> getParams() {
Map<String, String> params = new HashMap<>();
// the POST parameters:
}
};
Volley.newRequestQueue(this).add(postRequest);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment