title: Accept-Encoding in volley doesn't response with Content-Encoding
body: <p>I am developing a Restful Api. I am using laravel as backend (with apache) and for client I am using Android (with volley library for network communications).</p>
  
  <p>In one of my call I have the following:</p>
  
  <pre><code>JsonArrayRequest jsonObjReq = new JsonArrayRequest(url,
  new Response.Listener&lt;JSONArray&gt;() {
  
  @Override
  public void onResponse(JSONArray response) {
      Log.d("Response", response.toString());
      //PARSE JSON RESPONSE
      }
  }, new Response.ErrorListener() {
  
      @Override
      public void onErrorResponse(VolleyError error) {
      }
  }){
  
      @Override
      protected Response&lt;JSONArray&gt; parseNetworkResponse(NetworkResponse response) {
          for (Map.Entry&lt;String, String&gt; e: response.headers.entrySet()){
              Log.d(e.getKey(), e.getValue());
          }
          return super.parseNetworkResponse(response);
          }
  
      @Override
      public Map&lt;String, String&gt; getHeaders() throws AuthFailureError {
          Map&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
          map.put("Accept-Encoding","gzip,deflate");
          return map;
      }
  };
  </code></pre>
  
  <p>As you can see I set <code>Accept-Encoding :gzip,deflate</code>. </p>
  
  <p>When laravel receive the request, the headers exist:</p>
  
  <pre><code>array (
    'accept-encoding' =&gt; 
    array (
      0 =&gt; 'gzip,deflate',
    ),
    'host' =&gt; 
    array (
      0 =&gt; '192.168.1.104',
    ),
    'connection' =&gt; 
    array (
      0 =&gt; 'Keep-Alive',
    ),
    'user-agent' =&gt; 
    array (
      0 =&gt; 'Apache-HttpClient/UNAVAILABLE (java 1.5)',
    ),
    'cookie' =&gt; 
    array (
      0 =&gt; 'laravel_session=,
    ),
    'cookie2' =&gt; 
    array (
      0 =&gt; '$Version=1',
    ),
  )
  </code></pre>
  
  <p>But when android receive the response it doesn't contains <code>Content-Encoding : gzip</code> header, the headers that it contains are:</p>
  
  <pre><code>Transfer-Encoding﹕ chunked
  Date﹕ Sun, 21 Sep 2014 15:15:37 GMT
  Keep-Alive﹕ timeout=5, max=99
  Set-Cookie﹕ laravel_session=
  Content-Type﹕ application/json
  Connection﹕ Keep-Alive
  X-Powered-By﹕ PHP/5.4.9-4ubuntu2.4
  Server﹕ Apache/2.2.22 (Ubuntu)
  Cache-Control﹕ no-cache
  </code></pre>
  
  <p>When I do the same request via curl:</p>
  
  <pre><code>curl -I -H 'Accept-Encoding: gzip' url
  </code></pre>
  
  <p>it return:</p>
  
  <pre><code>HTTP/1.1 200 OK
  Date: Sun, 21 Sep 2014 14:46:12 GMT
  Server: Apache/2.2.22 (Ubuntu)
  X-Powered-By: PHP/5.4.9-4ubuntu2.4
  Cache-Control: no-cache
  Set-Cookie: laravel_session=
  Vary: Accept-Encoding
  Content-Encoding: gzip
  Content-Type: text/html; charset=UTF-8
  </code></pre>
  
  <p>So, summarizing, I set <code>Accept-Encoding:gzip,deflate</code>, the request is receiveb by server with that headers but when response is received by android <code>Content-Encoding</code> doesn't exist. It is not problem of my server because curl works good.</p>
  
  <p>Any suggestion? thanks</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I am watching data sent and received using Wireshark between android and my server. I am watching other request a part from that. This other request is made with <code>JsonObjectRequest</code> instead of <code>JsonArrayRequest</code> and with wireshark I can watch the following headers.</p>
  
  <p><em>Android -> Server</em></p>
  
  <pre><code>Content-Type: application/json\r\n
  Host: 192.168.1.104\r\n
  Connection: Keep-Alive\r\n
  User-Agent: Apache-HttpClient/UNAVAILABLE (java 1.5)\r\n
  [truncated] Cookie: laravel_session=
  Cookie2: $Version=1\r\n
  Accept-Encoding: gzip,deflate\r\n
  </code></pre>
  
  <p><em>Server -> android</em></p>
  
  <pre><code>Date: Sun, 21 Sep 2014 18:59:15 GMT\r\n
  Server: Apache/2.2.22 (Ubuntu)\r\n
  X-Powered-By: PHP/5.4.9-4ubuntu2.4\r\n
  Cache-Control: no-cache\r\n
  [truncated] Set-Cookie: laravel_session=
  Vary: Accept-Encoding\r\n
  Content-Encoding: gzip\r\n
  Connection: Keep-Alive\r\n
  Transfer-Encoding: chunked\r\n
  Content-Type: text/html; charset=UTF-8\r\n
  </code></pre>
  
  <p>In this request the response contains <code>Content-Encoding: gzip</code>. The only different between this request and the other is that this request uses <code>JsonObjectRequest</code> instead <code>JsonArrayRequest</code>, so cant ´JsonArrayRequest use Gzip encode?</p>