MCPcopy
hub / github.com/pallets/werkzeug / allowed_methods

Method allowed_methods

src/werkzeug/routing/map.py:683–694  ·  view source on GitHub ↗

Returns the valid methods that match for a given path. .. versionadded:: 0.7

(self, path_info: str | None = None)

Source from the content-addressed store, hash-verified

681 return True
682
683 def allowed_methods(self, path_info: str | None = None) -> t.Iterable[str]:
684 """Returns the valid methods that match for a given path.
685
686 .. versionadded:: 0.7
687 """
688 try:
689 self.match(path_info, method="--")
690 except MethodNotAllowed as e:
691 return e.valid_methods # type: ignore
692 except HTTPException:
693 pass
694 return []
695
696 def get_host(self, domain_part: str | None) -> str:
697 """Figures out the full host name for the given domain part. The

Callers 1

Calls 1

matchMethod · 0.95

Tested by 1