title: using httpbuilder for grails restful webservice
body: <p>I am developing a restful webservice using grails for first time and I following the chapter 13 in the grails documentation for setting up a simple response to a GET request.</p>
  
  <p>The thing i do not get is setting up  HTTPBuilder for creating a client which makes a get request. I have downloaded the jar httpbuilder,
  The Restful client is defined as follows</p>
  
  <pre><code>import groovyx.net.http.*
  import static groovyx.net.http.ContentType.JSON
  
  def http = new HTTPBuilder("http://localhost:8080/amazon")
  
  http.request(Method.GET, JSON) { url.path = '/book/list' response.success = { resp, json -&gt; for (book in json.books) { println book.title } } }
  </code></pre>
  
  <p>So the code they have customized for the client is it a new HTTPBuilder class defined ? if yes where do we need to define this class</p>
  
  <p>Right now the routing of URL to show def in my controller is not happeining.</p>
  
  <p>Thanks</p>