StringRequest request = new StringRequest(Request.Method.POST, BASE_URL, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
if (!response.equals(null)) {
// do something
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.e("tttt ", error.toString());
}
}) {
//This is for Headers If You Needed
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> params = new HashMap<String, String>();
params.put("Content-Type", "application/json; charset=UTF-8");
params.put("Key", "Value");
return params;
}
};
RequestQueue queue = Volley.newRequestQueue(getApplicationContext());
queue.getCache().clear();
queue.add(request);