title: Groovy wslite.rest.RestClient post or put results in a 411 Length Required Error
body: <p>Using the <code>wslite.rest.RestClient</code>, if I use <code>post</code> or <code>put</code>, I'm getting a 411 Length Required error returned from the service. I've added the header <code>Content-Length: (size)</code> but I still get an error. Does anyone have suguestions? Here's the code for a <code>put</code> request:</p>
  
  <pre><code>        def builder = new JsonBuilder()
          // required json data
          def root = builder {
              "ActivationDate" "\\/Date(1434563608000-0500)\\/"
              "EmailAddress" "ebaa@gmail.com"
              "ExpirationDate" "\\/Date(1435686808000-0500)\\/"
              "FirstName" "ebaa"
              "LastName" "ebaa"
              "MiddleName" "ebaa"
              "OtherName" "ebaa"
              "Password" "abc12345"
              "Status" 1
          }
  
          RESTClient restClient = new RESTClient('https://serviceBaseUrl')
          Response response
  
          try {
              restClient.authorization = new HTTPBasicAuthorization(username: 'user', password: 'pass')
              restClient.defaultCharset = 'UTF-8'
              restClient.defaultContentTypeHeader = 'application/json'
              restClient.defaultAcceptHeader = 'application/json'
  
              response = restClient.put(path: "/Location/${locName}/Administrator/${name}", 
                  headers:['Accept': 'application/json', 
                      'Accept-Language':'en-US,en;q=0.5', 'Content-Type': 'application/json; charset=UTF-8',
                      'Connection':'keep-alive', 'Pragma':'no-cache', 'Cache-Control':'no-cache', 
                      'Content-Length': builder.toString().length()], 
                      data: builder.toPrettyString().getBytes())
  
              return response.json
          } catch(ex) {
              ex.printStackTrace()
          }
  </code></pre>
  
  <p>I've also tried changing the data: param to body, but I get the same response. Also, If I use the Firefox plugin, HttpRequester (<a href="https://addons.mozilla.org/En-us/firefox/addon/httprequester/" rel="nofollow">https://addons.mozilla.org/En-us/firefox/addon/httprequester/</a>) and make the same request, I get a 200 status code and the appropriate data is updated. Thanks!</p>