The Grails Framework 3.1.1

See the light - agile, industrial strength, rapid web application development made easy

(Quick Reference) # responseFormats ## Purpose Statically defines the supported response formats used by the respond method. ## Examples

    class BookController {
        static responseFormats = ['xml', 'json']    def show(Long id) {
            respond Book.get(id)
        }
    }
## Description The `responseFormats` property is used to define the response formats supported by a controller and in turn used by the `respond` method. The `respond` method uses Content Negotiation to respond with the most appropriate content type. See the documentation on REST support for more information. | Quick Reference (hide)