title: How to check NON-html responses with Geb?
body: <p>Some of requests to my Web Application return data not in HTML format (JSON).</p>
  
  <p>How to handle this correctly?</p>
  
  <p>I wrote the following page definition:</p>
  
  <pre><code>import com.fasterxml.jackson.databind.ObjectMapper
  import geb.Page
  
  class JsonResponse extends Page {
  
      static url = null;
  
      static at = {
          true;
      }
  
      static ObjectMapper mapper = new ObjectMapper();
  
      static content = {
  
          readTree {
              def jsonString = $("pre").text();
              mapper.readTree(jsonString)
          }
  
      }
  
  }
  </code></pre>
  
  <p>and it apparently works. But the question is, how correct it is?</p>
  
  <p>It takes data from inside <code>pre</code> tag. This is because I saw this content inside <code>driver.pageSource</code>. Is this correct? May be it is driver-dependent?</p>
  
  <p>I put <code>null</code> into <code>url</code>, since the page has different url depending on query. Is this correct?</p>