title: How to make HTTP POST call with application/zip and multipart/form-data using plugin io.github.http-builder-ng.http-plugin in Groovy
body: <p>I am using the below code to make HTTP POST call to the server with the content type as <code>application/zip</code> and <code>multipart/form-data</code> using <code>io.github.http-builder-ng.http-plugin</code>.(One of the example shared <a href="https://http-builder-ng.github.io/http-builder-ng/asciidoc/html5/#_request" rel="nofollow noreferrer">here</a>)</p>
  
  <pre><code>plugins {
      id "io.github.http-builder-ng.http-plugin" version "0.1.1"  
  }
  import groovyx.net.http.ApacheEncoders
  import groovyx.net.http.*
  import groovyx.net.http.HttpConfigs.BasicHttpConfig
  import groovyx.net.http.OkHttpBuilder.OkHttpToServer
  import static groovyx.net.http.MultipartContent.multipart
  
  File msFile =new File("C:\\GradlePOC\\POC_1\\btest.zip");
  OkHttpBuilder.configure {
      request.uri = 'https://example.com'
      request.auth.basic 'ABC', 'XXXXX'
      request.encoder('application/zip'){ BasicHttpConfig config, OkHttpToServer req-&gt;
          req.toServer(new FileInputStream(
              msFile
          ))
      }
  }.post {
      request.uri.path = '/application/applications/3547/binaries'    
      request.contentType = 'multipart/form-data'
      request.body = multipart {      
          field 'name', 'data'
          part 'filename', 'btest.zip', 'application/zip', msFile     
      }
      request.encoder 'multipart/form-data', OkHttpBuilder.&amp;multipart    
  }
  </code></pre>
  
  <p>But the above code is not working for me. Any help would be much appreciated.</p>