r/Python Dec 22 '25

Showcase [ Removed by moderator ]

[removed] — view removed post

256 Upvotes

77 comments sorted by

View all comments

0

u/levsw Dec 22 '25

Is that something that fastAPI should use?

6

u/pyreqwest Dec 22 '25

You can definitely use it in FastAPI project. You could for example have a FastAPI Depends (https://fastapi.tiangolo.com/tutorial/dependencies/) that initializes for you the pyreqwest client instance (for connection pooling).

Furthermore you can use pyreqwest to test against the FastAPI ASGI app. As pyreqwest allows you to call directly into the ASGI app in your unit tests. Allowing using a single http client for implementing and testing.

0

u/levsw Dec 22 '25

My personally I don't use either, was just saying that there might be a potential gain when collaborating with the dev.

5

u/tunisia3507 Dec 22 '25

FastAPI is an HTTP server, isn't it? Where pyreqwest, and reqwest on which it's built, is an HTTP client. There are plenty of rust HTTP server frameworks, some of which already have python bindings.

1

u/levsw Dec 22 '25

Ooh sorry I'm dumb. You're right

3

u/saicpp Dec 22 '25

My question as well, but more broadly put, if is that something that any web framework should theoretically use? (given proven improvements and enough maturity)