see method in jsonObjectRequest post sending get code example
Example 1: jsonObjectRequest = new JsonObjectRequest( Request.Method.GET, url, ecplain
private DefaultHttpClient mHttpClient;
public RequestQueue getRequestQueue() {
if (mRequestQueue == null) {
mHttpClient = new DefaultHttpClient();
mRequestQueue = Volley.newRequestQueue(this, new HttpClientStack(mHttpClient));
}
return mRequestQueue;
}
public void setCookie() {
CookieStore cs = mHttpClient.getCookieStore();
cs.addCookie(new BasicClientCookie2("cookie", "spooky"));
}
setCookie();
mRequestQueue.add(request);
Example 2: jsonObjectRequest = new JsonObjectRequest( Request.Method.GET, url, ecplain
JsonObjectRequest req = new JsonObjectRequest(URL, new JSONObject(params),
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
}) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
HashMap<String, String> headers = new HashMap<String, String>();
headers.put("CUSTOM_HEADER", "Yahoo");
headers.put("ANOTHER_CUSTOM_HEADER", "Google");
return headers;
}
};