$name
$name : string
The HTTP request method should be:
- GET
- POST
- PUT
- DELETE
- OPTIONS
- HEAD
- TRACE
- CONNECT
Add more HTTP request methods to the same class method by using commas. If a class method has no @Method, then any HTTP request method will execute that class method.
*@Api("my/route") // put this in javadoc style
// No @HttpMethod annotation, accepts all HTTP request methods
public function myRoute() {
// code
}
*@Api("route/with/$var") // put this in javadoc style
*@HttpMethod("PUT") // accepts only PUT requests
public function routeWith($var) {
// code
}
*@Api("another/$id/maybe/$var") // put this in javadoc style
*@HttpMethod("GET,POST") // accepts only GET and POST requests
public function routeAnother($id, $var) {
// code
}