title: How to get cURL to output only HTTP response body (JSON) and no other headers etc
body: <p>I am using curl in a bash script to fetch the response of a service as below,</p>
  <pre><code>response=$(curl -isb -H &quot;Accept: application/json&quot; &quot;http://host:8080/some/resource&quot;)
  </code></pre>
  <p>Service response is of json type and on browser I could perfectly fine response.<br />
  However curl response has other unwanted things (such as set-cookie, content-length header in this case) and sometimes the actual response is eaten up.</p>
  <p>Here is the output of <code>echo $response</code> &gt;</p>
  <pre><code> Set-Cookie: rack.session=BAh7CEkiD3Nlc3Npb25faWQGOgZFVEkiRWJlY2JiOTE2M2Q1ZWI4NThjMDdi%0AYjRiOWRjMGMxMGEwYTBkMjE3NmJhZDVjYzY4YjY4ZTlmMTE2ZGVkYWE3MTMG%0AOwBGS
  SIJY3NyZgY7AEZJIiVhZmQ2MmUyZGMxMzFmOGEwMjg3NDlhNWM3YmVm%0AN2FjNwY7AEZJIg10cmFja2luZwY7AEZ7B0kiFEhUVFBfVVNFUl9BR0VOVAY7%0AAFRJIi00MTc0OGM2MWNkMzljZTYxNzY3ZjU0
  Y2I5OTdiYWRkN2MyNTBkYmU4%0ABjsARkkiGUhUVFBfQUNDRVBUX0xBTkdVQUdFBjsAVEkiLWRhMzlhM2VlNWU2%0AYjRiMGQzMjU1YmZlZjk1NjAxODkwYWZkODA3MDkGOwBG%0A--ee97a62095e7d42129
   tontent-Length: 354c8; path=/; HttpOnly
  </code></pre>
  <p>This is breaking my response parsing logic.<br />
  I have seen this happening intermittently which is weird.</p>
  <p>Is there a way to get <strong>&quot;only&quot;</strong> json response from cURL output?<br />
  I went through the curl documentation but could not see any thing/ or I could have missed it.</p>