Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can Falcon dispatch to a callable based on any property of a request, not just request method (GET/POST etc)? #709

Closed
dukedougal opened this issue Feb 18, 2016 · 3 comments

Comments

@dukedougal
Copy link

accept headers, cookies, query strings, etc.

@dukedougal dukedougal changed the title Can Falcon dispatch to a callable based on any property of a request, not just method? Can Falcon dispatch to a callable based on any property of a request, not just request method (GET/POST etc)? Feb 18, 2016
@kgriffs kgriffs added this to the 1.0 milestone Feb 29, 2016
@kgriffs
Copy link
Member

kgriffs commented Feb 29, 2016

Currently API._get_responder() looks up the responder based on the path and HTTP method in the request. You could inherit from API and override _get_responder() to make it more flexible. Depending on what you need to do, a sink may also work.

@dukedougal
Copy link
Author

OK. Although it would be nice if it was kinda built in as a core feature without need to do sinks or overrides.

@vytas7
Copy link
Member

vytas7 commented Feb 20, 2022

I'm going to close this since it's unlikely that we are going to support dispatching based on any property of a request in the default router.
However, since #967, routers get access to the full req object, so a custom router can now be used to achieve just that.

A subset of this issue, routing based on query string parameters, is tracked in #838.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants