## 6.4.5 Mapping to HTTP methods

URL mappings can also be configured to map based on the HTTP method (GET, POST, PUT or DELETE). This is extremely useful for RESTful APIs and for restricting mappings based on HTTP method.

As an example the following mappings provide a RESTful API URL mappings for the `ProductController`:

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