Skip to content

Routes cannot use the exact parameters #1752

Answered by jhominal
yi250 asked this question in Q&A
Discussion options

You must be logged in to vote

Route.endpoint currently accepts either:

  • a function or method that takes a starlette.requests.Request and returns a starlette.responses.Response object (like your text),
  • or a class that has an __init__ that implements the ASGI interface (which you can use by e.g. subclassing starlette.endpoints.HTTPEndpoint).

As apps is not in either case, it doesn’t work with Route.endpoint as currently implemented by Starlette.

There is more information in the documentation, in the Routing section.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Kludex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1751 on July 10, 2022 07:41.