@groovy.transform.CompileStatic interface Response
Allows control over the page response (headers, content type, status)
Type Params | Return Type | Name and description |
---|---|---|
|
abstract void |
contentType(java.lang.String contentType) Set the response content type |
|
abstract void |
encoding(java.lang.String encoding) Sets the response encoding |
|
abstract void |
header(java.lang.String name, java.lang.String value) Set a response header |
|
abstract void |
header(java.util.Map<java.lang.String, java.lang.String> nameAndValue) Set a single named value header |
|
abstract void |
headers(java.util.Map<java.lang.String, java.lang.String> namesAndValues) Set multiple headers |
|
abstract void |
status(int status) Sets the response status |
|
abstract void |
status(int status, java.lang.String message) Sets the response status |
|
abstract void |
status(HttpStatus status) Sets the response status |
|
abstract void |
status(HttpStatus status, java.lang.String message) Sets the response status |
Set the response content type
Sets the response encoding
Set a response header
name
- The name of the headervalue
- The value of the headerSet a single named value header
nameAndValue
- The name and value. Example header(foo:"bar")Set multiple headers
namesAndValues
- The names and valuesSets the response status
status
- The statusSets the response status
status
- The statusSets the response status
status
- The statusSets the response status
status
- The status