Binds an HTTPController responder method to an HTTP Method (e.g., GET, POST)
HTTPController methods with this metadata will be invoked when method matches the HTTP method of the incoming request.
For example, the following controller invokes getOptions
when it receives an HTTP OPTIONS request:
class UserController extends HTTPController {
@HTTPMethod("options")
Future<Response> getOptions() => return new Response.ok(null);
}
This is the generic form of httpGet, httpPut, httpPost and httpDelete.
Constructors
- HTTPMethod(String method)
-
Creates an instance of HTTPMethod that will case-insensitively match the HTTP method of a request.
const
Properties
- method → String
-
An HTTP method name.
final - hashCode → int
-
The hash code for this object.
read-only, inherited - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Operators
-
operator ==(
other) → bool -
The equality operator.
inherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited -
toString(
) → String -
Returns a string representation of this object.
inherited