title: Unable to download pdf file by consuming REST webservice in Grails
body: <p>I am using Grails Plugin rest=0.7 for consuming a Rest Webservice.</p>
  
  <p>Everything works fine when the response from the service is xml but in case if response is file type like pdf it must start downloading on sending the request but the downloading is not starting at all.</p>
  
  <p>The below code in implemented in a grails service.</p>
  
  <pre><code>    String httpUrl = 'http://abc.com/myService'
      String data = '&lt;methodcall protocol="2" method="avalidmethodname"&gt;&lt;cmdid/&gt;&lt;data&gt;&lt;project_id&gt;1&lt;/project_id&gt;&lt;user_id&gt;2&lt;/user_id&gt;&lt;operation&gt;ABC&lt;/operation&gt;&lt;filter&gt;&lt;status_type_id&gt;1&lt;/status_type_id&gt;&lt;scope_bits&gt;00&lt;/scope_bits&gt;&lt;/filter&gt;&lt;/data&gt;&lt;/methodcall&gt;'
       String respText = ''
      HttpClient httpClient = new DefaultHttpClient()
      HttpResponse response
      try {
          HttpPost httpPost = new HttpPost(httpUrl)
          httpPost.setHeader("Content-Type", "text/xml")
          HttpEntity reqEntity = new StringEntity(data, "UTF-8")
          reqEntity.setContentType("text/xml")
          reqEntity.setChunked(true)
          httpPost.setEntity(reqEntity)
          response = httpClient.execute(httpPost)
       //   HttpEntity resEntity = response.getEntity()
       //   respText = resEntity.getContent().text
      }
      finally {
          httpClient.getConnectionManager().shutdown()
      }
      return response
   //  return respText 
  </code></pre>
  
  <p>The commented lines in code is for the case of xml response.</p>
  
  <p>Please help me to resolve this problem, i am not sure the approach i am using is valid in case of file response from the webservice.</p>