mirror of
https://github.com/SergioBenitez/Rocket.git
synced 2026-02-06 10:48:05 +00:00
This commit introduces support for method-less routes and route
attributes, which match _any_ valid method: `#[route("/")]`. The `Route`
structure's `method` field is now accordingly of type `Option<Route>`.
The syntax for the `route` attribute has changed in a breaking manner.
To set a method, a key/value of `method = NAME` must be introduced:
```rust
#[route("/", method = GET)]
```
If the method's name is a valid identifier, it can be used without
quotes. Otherwise it must be quoted:
```rust
// `GET` is a valid identifier, but `VERSION-CONTROL` is not
#[route("/", method = "VERSION-CONTROL")]
```
Closes #2731.
|
||
|---|---|---|
| .. | ||
| 00-introduction.md | ||
| 01-upgrading.md | ||
| 02-quickstart.md | ||
| 03-getting-started.md | ||
| 04-overview.md | ||
| 05-requests.md | ||
| 06-responses.md | ||
| 07-state.md | ||
| 08-fairings.md | ||
| 09-testing.md | ||
| 10-configuration.md | ||
| 11-deploying.md | ||
| 12-pastebin.md | ||
| 13-conclusion.md | ||
| 14-faq.md | ||
| index.md | ||