From c7d194ee3fd5038658919ffba47f3e52d5d25309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?On=C3=A8?= <43485962+c-git@users.noreply.github.com> Date: Wed, 18 Dec 2024 04:11:07 -0500 Subject: [PATCH] docs: disabiguate method for a callable from http method (#508) * docs: disabiguate method for a callable from http method Already said HTTP Method but added a link to highlight the difference. And a note to say that it doesn't change the matching rules. * Update url-dispatch.md --------- Co-authored-by: Rob Ede --- docs/url-dispatch.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/url-dispatch.md b/docs/url-dispatch.md index 5897ef7..de0c7e1 100644 --- a/docs/url-dispatch.md +++ b/docs/url-dispatch.md @@ -14,7 +14,7 @@ URL dispatch provides a simple way for mapping URLs to handler code using a simp Resource configuration is the act of adding a new resources to an application. A resource has a name, which acts as an identifier to be used for URL generation. The name also allows developers to add routes to existing resources. A resource also has a pattern, meant to match against the _PATH_ portion of a _URL_ (the portion following the scheme and port, e.g. _/foo/bar_ in the _URL_ _`http://localhost:8080/foo/bar?q=value`_). It does not match against the _QUERY_ portion (the portion that follows _?_, e.g. _q=value_ in _`http://localhost:8080/foo/bar?q=value`_). -The [_App::route()_][approute] method provides simple way of registering routes. This method adds a single route to application routing table. This method accepts a _path pattern_, _HTTP method_ and a handler function. `route()` method could be called multiple times for the same path, in that case, multiple routes register for the same resource path. +The [_App::route()_][approute] method provides simple way of registering routes. This method adds a single route to the application routing table. This method accepts a _path pattern_, [_HTTP method_][httpmethod] and a handler function. The `route()` method could be called multiple times for the same path, in that case, multiple routes register for the same resource path. Note: the first match is used so unless the [_HTTP method_][httpmethod] or guards are different only the first will be used (see [route matching](#route-matching) for more info). @@ -300,3 +300,4 @@ If the path pattern can not be found in the routing table or a resource can not [implfromrequest]: https://docs.rs/actix-web/4/actix_web/trait.FromRequest.html [implresponder]: https://docs.rs/actix-web/4/actix_web/trait.Responder.html [pathextractor]: /docs/extractors +[httpmethod]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods