twisted / klein

werkzeug + twisted.web
Other
833 stars 120 forks source link

Make new request/response API public #253

Open wsanchez opened 6 years ago

wsanchez commented 6 years ago

Make new request/response API public. That would add to the package (__init__.py):

Before these become public, the following tickets need to be addressed:

wsanchez commented 6 years ago

This is mostly here to keep track of what needs to happen first.

glyph commented 6 years ago

We might want to chat a little bit about accessing the request objects via this new API vs. accessing them entirely through dependency injection. For example:

@route.get("/blah")
def blah(self, request):
    request.someNicerMethodForRetrievingAHeader(...)

vs.

@require(route.get("/blah"), header=Header("hello-world"))
def blah(self, header):
    print(header)

we are using an entirely request-less style at work and I'm really digging it.