title: Sending POST with groovy and data is already URL-encoded
body: <p>I'm trying to send a POST using Groovy HTTPBuilder but the data I want to send is already URL-encoded so I want HTTPBuilder to POST it as is. I tried the following:</p>
  
  <pre><code>def validationString = "cmd=_notify-validate&amp;" + postData
  def http = new HTTPBuilder(grailsApplication.config.grails.paypal.server)
  http.request(Method.POST) {
      uri.path = "/"
      body = validationString
      requestContentType = ContentType.TEXT
  
      response.success = { response -&gt;
              println response.statusLine
      }
  }
  </code></pre>
  
  <p>But it gives me a NullPointerException:</p>
  
  <pre><code>java.lang.NullPointerException
  at groovyx.net.http.HTTPBuilder$RequestConfigDelegate.setBody(HTTPBuilder.java:1200)
  </code></pre>