title: How can I perform HTTP POST requests from within a Jenkins Groovy script?
body: <p>I need to be able to create simple HTTP POST request during our <a href="https://github.com/jenkinsci/workflow-plugin" rel="noreferrer">Jenkins Pipeline</a> builds. However I cannot use a simple curl sh script as I need it to work on Windows and Linux nodes, and I don't wish to enforce more tooling installs on nodes if I can avoid it.</p>
  
  <p>The Groovy library in use in the Pipeline plugin we're using should be perfect for this task. There is an extension available for Groovy to perform simple POSTs called <a href="http://mvnrepository.com/artifact/org.codehaus.groovy.modules.http-builder/http-builder/0.7.1" rel="noreferrer">http-builder</a>, but I can't for the life of me work out how to make use of it in Jenkins' Groovy installation.</p>
  
  <p>If I try to use Grapes Grab to use it within a Pipeline script I get an error failing to do so, <a href="https://gist.github.com/strich/38e472eac507bc73e785" rel="noreferrer">as seen here</a>.</p>
  
  <pre><code>@Grapes(
      @Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7.1')
  )
  </code></pre>
  
  <p>Maybe Grapes Grab isn't supported in the bundled version of Groovy Jenkins uses. Is it possible to simply download and add http-builder and its dependencies to the Jenkins Groovy installation that goes out to the nodes?</p>