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

Allow to override the default responders via on_request() #2071

Open
vytas7 opened this issue May 22, 2022 · 0 comments
Open

Allow to override the default responders via on_request() #2071

vytas7 opened this issue May 22, 2022 · 0 comments

Comments

@vytas7
Copy link
Member

vytas7 commented May 22, 2022

In addition to on_get(), on_post(), etc, could we allow redefining the default responders via a generic on_request()?
This idea is borrowed from the Responder framework (which is in turned inspired by Falcon and Flask), see: Class-Based Views.

Responder itself is sort of abandoned, so it was challenging to even get a test program running, but once I got it up, it seemed that providing both on_request() AND on_get() in Responder makes the said framework call both upon GET. Which IMHO doesn't fit well into Falcon's design, so maybe we could instead map on_request (if provided) only instead of the default responders. See also: #735.

Opinions welcome on what to do with on_options(), if not provided. Maybe we could still provide a default on_options(), and not use on_request() for that, in order to minimize the breaking impact of this change, and for convenience.

This change could potentially pave the way to further unifying resources and sinks, see also

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

1 participant