Pattern Matching and Parameter
package:angel3_framework
has nice support for injecting values from HTTP headers, query string, and session/cookie values, as well as pattern-matching for request handlers.
These act as a clean shorthand for commonly-used functionality.
Here is a simple example of each of them in action:
@Header()
@Header()
A simple parameter annotation to inject the value of a sent HTTP header. Throws a 400 if the header is absent.
@Query()
@Query()
Searches for the value of a query parameter.
@Session()
@Session()
Fetches a value from the session.
@CookieValue()
@CookieValue()
Gets the value of a cookie.
@Parameter()
@Parameter()
The base class driving the above matchers.
Supports:
defaultValue
required
custom
error
message
https://pub.dev/documentation/angel3_framework/latest/angel3_framework/Parameter-class.html
Last updated