title: How to avoid chunked encoding when the rest api is passing through APIMan?
body: <p>I believe I got an error on my app.</p>
  
  <p>When I try to retrieve info from url, I got an error on JSON object.
  It occurs because some reason, the APIMan include a kind of encoding in the response. Here is my code:</p>
  
  <pre><code>Client client = Client.create();
  WebResource webResource = client.resource(uri);
  ClientResponse response = webResource.header("X-API-Key", xApiKey)
      .header("Content-Type", "application/json; charset=UTF-8")
      .header("Accept", "application/json")
      .header("Authorization", "Bearer " + token)
      .get(ClientResponse.class);
  String json = response.getEntity(String.class);
  </code></pre>
  
  <p>when I send a request through apiman, my response is showed with special characters:</p>
  
  <pre><code>public static void main(String[] args) {
      String uri = "https://apiman.url/apiman-gateway/org/api/1.0/method";
      String apiKey = "894fd5b3-36f0-32974-xxxxxxxx"; 
      get("token", uri, apiKey);
  }
  
  // response is 1ff8\r\n{"data":...1ff8\r\nSim"[9867,"CAR\r\n1c7d\r\n...}\r\n0\r\n\r\n
  </code></pre>
  
  <p>when I do not use apiman, then my response is different as showed below:</p>
  
  <pre><code>public static void main(String[] args) {
      String uri = "https://192.168.56.22:8080/app/method";
      String apiKey = "not needed"; 
      get("token", uri, apiKey);
  }
  
  // response is ok {"data":...Sim"[9867,"CAR...}
  </code></pre>
  
  <p><strong>PS.:The part of '...' it was just me to not pass all data here.</strong></p>
  
  <p>Does anyone had the same problem? It seems that some characteres has different encoding type.</p>
  
  <p><strong>Edit.1:</strong></p>
  
  <p>If I try to access the apiman url directly, the response is showed ok:</p>
  
  <pre><code>https://apiman.url/apiman-gateway/org/api/1.0/method?apikey=894fd5b3-36f0-32974-xxxxxxxx
  
  // response is ok {"data":...Sim"[9867,"CAR...}
  </code></pre>
  
  <p>In another test, I used the cUrl method:</p>
  
  <pre><code>curl -i -X GET -H "Content-Type:application/json" -H "X-API-Key:894fd5b3-36f0-32974-xxxxxxxx" 'https://apiman.url/apiman-gateway/org/api/1.0/method'
  
  /* response is 1ff8
  {"data":...
  1ff8
  Sim"[9867,"CAR
  1c7d
  ...}
  0
  
  */
  </code></pre>
  
  <p><strong>Edit.2:</strong></p>
  
  <p>For some reason the problem occurs again.</p>
  
  <p>Is there a way to solve this?</p>