abstract class AbstractGrailsMockHttpServletResponse extends MockHttpServletResponse
Simple sub-class of Spring's MockHttpServletResponse that adds the left-shift operator, "<<".
| Constructor and description |
|---|
AbstractGrailsMockHttpServletResponse() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
JSONElement |
getJson()Get the response JSON |
|
java.lang.String |
getRedirectUrl() |
|
java.lang.String |
getRedirectedUrl() |
|
java.lang.String |
getText()The response body as text |
|
groovy.xml.slurpersupport.GPathResult |
getXml()Get the response XML |
|
java.lang.String |
header(java.lang.String name)Return the primary value for the given header as a String, if any. |
|
java.util.List<java.lang.String> |
headers(java.lang.String name)Return all values for the given header as a List of Strings. |
|
void |
leftShift(java.lang.String content)Appends the given content string to the response's output stream. |
|
void |
reset() |
|
void |
setFormat(java.lang.String format)Sets the response format |
Get the response JSON
The response body as text
Get the response XML
Return the primary value for the given header as a String, if any. Will return the first value in case of multiple values.
name - the name of the headernull if noneReturn all values for the given header as a List of Strings.
name - the name of the headerAppends the given content string to the response's output stream.
Sets the response format
format - The format of the response