Page created: 26 Jul 2021 |
Page updated: 14 Jan 2022
This object accesses the Body object in Groovy
The Body object contains the HTTP body from the application request or the HTTP body from the site response. The request HTTP body is sent on to the site after the rules are evaluated. The response HTTP body is sent on to the User-Agent after the response rules are evaluated.
//Checks the actual length of the body content and set the Content-Length response header def body = exc?.response?.body; def header = exc?.response?.header; header?.setContentLength(body?.getLength()); pass();
|byte getContent()||Returns the body content of the request or response.|
|int getLength()||Returns the length of the body content.|