respond
Purpose
Attempts to return the most appropriate type for the requested content type (specified by either the Accept
header or file extension)
Examples
// pick the best content type to respond with respond Book.get(1)// pick the best content type to respond with from the given formats respond Book.get(1), [formats:['xml', 'json']]
Description
The respond method uses Content Negotiation to respond with the most appropriate content type. See the documentation on REST support for more information.
Parameters:
object
- The object to renderarguments
- A map of arguments.
Supported arguments
:
view
- The view to use in case of HTML renderingmodel
- The model to use in case of HTML rendering