title: Get Plain HTML from HTTP Requests
body: <p>I'm working on a grails app and for several hours already have been trying to get html code from a request. What I want to do is to get plain html (like in a webPage source, with all tags and stuff), so that i can work on that.</p>
  
  <p>I have already managed to get it for my get requests with this code:</p>
  
  <pre><code>url = ("http://google.com").toURL().getText())
  </code></pre>
  
  <p>It works just fine, but I also need to be able to make post requests.</p>
  
  <p>I've tried with httpBuilder, but the response I'm getting looks like well formated text (with white spaces and stuff), but that hasn't got any html tags, and I need them. Code I'm using looks like this:</p>
  
  <pre><code>def url = "http://urlToRemoteServer.com/"
  def http = new HTTPBuilder(url);
  
  
  http.post( path: 'pathToMyApp',
          requestContentType: "text/xml" ) { resp, reader -&gt;
  
              println "Tweet response status: ${resp.statusLine}"
              assert resp.statusLine.statusCode == 200
              System.out &lt;&lt; reader
          }
  </code></pre>
  
  <p>Can anyone tell me how to get that html code? I'm working on groovy, but Java solution will be just as good.</p>