title: Getting E_NOT_ACCEPTABLE_MEDIA_TYPE status code 406
body: <p>I had developed a REST service to read the content of the file and then pass byte[] as the response. However, after making GET REST call I'm getting E_NOT_ACCEPTABLE_MEDIA_TYPE error.</p>
  
  <p>Following is what I'm doing,</p>
  
  <ol>
  <li>Fetching content from the file in the form of InputStream</li>
  <li>Converting InputStream to a byte[]</li>
  <li>Converting byte[] to a Base64 encoded byte[]</li>
  <li>Using HttpServletResponse I'm sending Base64 encoded byte[]</li>
  </ol>
  
  <p>Here I'm setting the content-type to file MIME type. Also tried other values like 'multipart/form-data', 'text/plain', but in vain</p>
  
  <p>Similar I tried setting the Base64 encoded String to HttpServletResponse. In both the cases, I'm getting an E_NOT_ACCEPTABLE_MEDIA_TYPE error.</p>
  
  <p>Need inputs on how to resolve this error.</p>
  
  <p>Thanks.</p>