title: How to know the size of payload in response interceptor using grails
body: <p>I am using grails spring boot for my project. and I am also using interceptors and filters. Currently, I have a test case to include the size of response data. For this, in interceptor, I have integrated the after method of grails interceptor. while debugging, I didn't found any method to know the data size which i sent from my controller. e.g</p>
  
  <pre><code>    class RestController {
           def show  {
              def data = [:]
              data.put("object", "some data objects " );
  
              withFormat {
                  json {
                      render wrapper as JSON
                  }
              }
  
          }
      }
  </code></pre>
  
  <p>// interceptor.</p>
  
  <pre><code>    class RestInterceptor {
  
          RestInterceptor(){
              match(controller:"rest", action:"*")
          }
  
          boolean before() {
              println( request)
              true }
  
          boolean after() {
              println response
              true
          }
  
          void afterView() {
              // no-op
          }
      }
  </code></pre>
  
  <p>In response object, Their is not any method to know the content length. However, I can see the same in request object. please give suggestion. </p>