title: Groovy ws-lite REST post with json payload
body: <p>I am trying to call a REST API via the ws-lite.  Get works great but calling a post with a json payload not working.  Bit of a noob but from github notes wiki i am not sure <a href="https://github.com/jwagenleitner/groovy-wslite" rel="nofollow">https://github.com/jwagenleitner/groovy-wslite</a></p>
  
  <pre><code>@Grab('com.github.groovy-wslite:groovy-wslite:1.1.2')
  import wslite.rest.*
  import groovy.json.JsonBuilder
  def client = new    RESTClient("https://d.la10.salesforceliveagent.com/chat/rest")
  def response = client.get(path:'/System/SessionId', headers:['X-LIVEAGENT-    API-VERSION':'36','X-LIVEAGENT-AFFINITY':'null'])
  
  def skey = response.json.key
  def sid = response.json.id
  def stoken = response.json.affinityToken
  
  
  client.post(path:'/Chasitor/ChasitorInit', headers:['X-LIVEAGENT-API-VERSION':'36','X-LIVEAGENT-SESSION-KEY':skey,'X-LIVEAGENT-AFFINITY':stoken,'X-LIVEAGENT-SEQUENCE':'1'])
  {
      type ContentType.application/json
           json {
               "organizationId": "00D28000000f5N9",
               "deploymentId": "572280000008R6L",
               "buttonId": "573D000000000OC",
               "agentId": "005B0000000F3b2",
               "doFallback": true,
               "sessionId": sid,
               "userAgent": "Lynx/2.8.8",
               "screenResolution": "2560x1440",
               "visitorName": "Jon A",
               "prechatDetails": [],"prechatEntities": [],
               "receiveQueueUpdates": true,
               "isPost": true
           }
  }
  </code></pre>
  
  <p>Curious if anyone has an example using for a post with REST via ws-lite from groovy.  I simply get compilation failures based on the json format.   Any insight appreciated  </p>