Brief Introduction to REST

This is from a guest lecture that I delivered to a web-programming class at Bethel University this past month.

Grails Supports REST in various ways:
Exposing resources in URL Mappings:

static mappings = {
"/product/$id?"(resource:"product")
}

Or specifically mapping HTTP Methods to actions

"/product/$id"(controller:"product"){
action = [GET:"show", PUT:"update", DELETE:"delete", POST:"save"]
}

Also checkout my post on overriding the HTTP Method with Grails or a more in-depth look at RESTful Grails.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*