how to add headers google volley?

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

how to add headers google volley?

Postby scherman » Mon Oct 07, 2013 3:34 am

well, i am new in this forum, please if you could help me in this. i searched but i could not find how to add headers to a volley request. i have this code and i want to add the accept-encoding:gzip and the api key. i would appreciate your help. here is the code:

type = "cafe";
url = "" + Global.location + "&radius=500&types=" + type + "&sensor=true&key="+placesKey;

RequestQueue rq = Volley.newRequestQueue(context);

JsonObjectRequest jsonRequest = new JsonObjectRequest(Request.Method.GET, url, null,
new Response.Listener<JSONObject>() {
public void onResponse(JSONObject response) {

List<Review> reviews = new ArrayList<Review>();
reviews = Parsing.ParseReviews(response);
}, new Response.ErrorListener() {

public void onErrorResponse(VolleyError error) {
Toast.makeText(context, error.toString(), Toast.LENGTH_SHORT).show();


Once Poster
Once Poster
Posts: 1
Joined: Sun Jun 09, 2013 8:58 pm


Return to Networking & Database Problems

Who is online

Users browsing this forum: No registered users and 3 guests