starlette
starlette copied to clipboard
The little ASGI framework that shines. 🌟
Cache the request `body` and `stream_consumed` in the ASGI scope, rather than on the request instance. This preserves the existing behaviours when calling `.body()` or `.stream()` multiple times, but extends...
Hi folks, Currently, the `TestClient` is built as a subclass of `requests.Session`. What would be thoughts on migrating to [HTTPX](https://github.com/encode/httpx)? - Is this a good idea at all? - Should...
Hi. I was wondering if sub-applications (mounted on the main application) should receive startup/shutdown events and call their own handlers. I saw it is not the case at the moment....
Proposed fix for https://github.com/encode/starlette/issues/814 This modifies the lookup of routes by name to first look in the routes of the mounted app before resolving routes in the root app. ####...
I'm currently trying to integrate some metrics tooling in a middleware where I need to inspect the request body. The problem I am seeing is that this triggers the request...
I'm implementing an API in Fastapi, using `APIRouter`s for different resources. When I want to get the URL of an item in a resource, I use the `starlette.requests.Request` objects `url_for()`...
I'm trying to compose apps from smaller Starlette apps. I can't find a way to make mounted apps that work regardless of app that is mounting them when using url_for....
This PR adds `size` attribute to `UploadFile`, enabling for easy retrieval of uploaded file's size in bytes without need for seeking file's end and telling its size. This is achieved...
I totally misunderstood `url_for`'s API, I was expecting `url_for('some_route', foo='bar')` to return `'http://testserver/my_route/?foo=bar'`. I understand why that is now, but what is the best way to generate urls like this?...
Is there a way to obtain which route the request is taking in middleware? Right now, the only available thing is `request.url.path`, which doesn't give me a nice name for...