-
Notifications
You must be signed in to change notification settings - Fork 56
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
Expose request to handlers #10
Comments
This is a good idea. It wouldn't hurt to pass the full This opens the question "How far should it go?" Suppose the handler would be able to write headers as well, then the
That doesn't seem like too much complexity, but some users might not care about the request and header at all, but would still have to import the "net/http" package for the parameter types. That could replace the "net/url" they already import. As a further possibility, There are other plans too (#8, #9) so I bet the handler signature will look quite different a month from now. |
Hey guys, sorry for the very delayed response. My vision for sleepy is that it is simple and easy to get going. Part of fulfilling that vision is that sleepy will parse the request and give it to the handlers in a simple-to-use format. Passing the entire request to the handlers is pretty contrary to that idea. I agree that the request object needs to be exposed somehow, but I don't want it to be directly passed in to the handlers. Thanks for the ideas! |
Request should be exposed for all handlers. What if you want to read headers (authentication, ip address, etc...)
The text was updated successfully, but these errors were encountered: