title: Groovy httpbuilder post list params
body: <p>I'm trying to consume a web service from my grails project. I'm using httpbuilder 0.7.2. Below is my http client.</p>
  
  <pre><code>static def webServiceRequest(String baseUrl, String path, def data,method=Method.GET,contentType=ContentType.JSON){
  
              def ret = null
              def http = new HTTPBuilder(baseUrl)
              http.request(method, contentType) {
                  uri.path = path
                  requestContentType = ContentType.URLENC
                  if(method==Method.GET)
                      uri.query = data
                  else
                      body = data
                  headers.'User-Agent' = 'Mozilla/5.0 Ubuntu/8.10 Firefox/3.0.4'
                  response.success = { resp, json -&gt;
                      println "response status: ${resp.statusLine}"
                      ret = json
                      println '--------------------'
                  }
              }
              return ret
  
      }
  </code></pre>
  
  <p>The issue is coming when i'm trying to send something like this:</p>
  
  <pre><code>def input = [:]
  input['indexArray'] = [1,5]
  </code></pre>
  
  <p>api call</p>
  
  <pre><code>def response = webServiceRequest(url,uri,input,Method.POST)
  </code></pre>
  
  <p>when i'm printing the value of post data in my server it shows only last value of list.</p>
  
  <p><strong>{"indexArray":"5"}</strong></p>
  
  <p>it should show both <strong>1 and 5</strong></p>