title: Add custom headers with Volley library
body: <p>I start using Volley for my application and I want to add custom headers for each request as a security identifier.
  I'm using a <code>JsonObjectRequest</code> and overriding the <code>getHeaders()</code>.</p>
  
  <pre><code>JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET,
                          url,
                          null,
                          new Response.Listener&lt;JSONObject&gt;() {
                              @Override
                              public void onResponse(JSONObject response) {
                                  Log.d(TAG, response.toString());
                              }
                          },
                          new Response.ErrorListener() {
                              @Override
                              public void onErrorResponse(VolleyError error) {
                                  Log.d(TAG, error.toString());
                              }
                          }) {
                      @Override
                      public Map&lt;String, String&gt; getHeaders() throws AuthFailureError {
                          HashMap&lt;String, String&gt; headers = new HashMap&lt;&gt;();
                          String mApiKey = "123";
                          headers.put("APIKEY", mApiKey);
                          return headers;
                      }
  
                      @Override
                      protected Map&lt;String, String&gt; getParams() throws AuthFailureError {
                          Map&lt;String, String&gt; params = new HashMap&lt;&gt;();
                          params.put("param1", "1");
                          params.put("param2", "2");
                          params.put("param3", "3");
                          return params;
                      }
                  };
                  VolleySingleton.getInstance(getActivity()).addToRequestQueue(jsonObjectRequest);
  </code></pre>
  
  <p>But I get this error:</p>
  
  <pre><code>E/Volley﹕ [23620] BasicNetwork.performRequest: Unexpected response code 401 for http://...
  </code></pre>
  
  <p>The <code>AuthFailureError</code> is thrown.</p>
  
  <p>I also try to use <code>StringRequest</code> but same error.</p>
  
  <p>If someone is in the same case and have solution, thank you in advance!</p>