title: Can't send InputStream object using grails rest-client-builder
body: <p>I've been using rest-client-builder plugin (<a href="http://grails.org/plugin/rest-client-builder" rel="nofollow">http://grails.org/plugin/rest-client-builder</a>) and faced with problem to send a file as inputStream object.</p>
  
  <p>From plugin documentation: </p>
  
  <blockquote>
    <blockquote>
      <blockquote>
        <p>Multipart requests are possible by setting properties of the request body to File, URL, byte[] or InputStream instances:</p>
      </blockquote>
    </blockquote>
  </blockquote>
  
  <pre><code>def resp = rest.post(url) {
          contentType "multipart/form-data"
          zip = new File(pluginPackage)
          pom = new File(pomFile)
          xml = new File(pluginXmlFile)
      }
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>def post(String url, InputStream photo, String contentType, Cookie[] cookies = null) {
      def rest = new RestBuilder()
  
      def cookiesHeaderString = ""
      if (cookies) {
          cookiesHeaderString = WebUtils.buildCookiesHeader(cookies)
      }
  
      def resp = rest.post(url) {
          header "Cookie", cookiesHeaderString
          file = photo
          contentType "multipart/form-data"
      }
  
      return resp?.responseEntity?.body
  }
  </code></pre>
  
  <p>Could somebody suggest how can I send an InputStream object or what I'm doing wrong?</p>