Skip to content

raphaelauv/fastAPI-httpx-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python

Full example of FastAPI with a httpx client

This is an example with FastAPI, but you can use this logic with any async ( ASGI ) web framework

Implemented logic :

(with a fake server mocking answer of httpx)

  • Open AsyncClient at fastAPI startup

  • Close AsyncClient at fastAPI shutdown

Tests

  • fastAPI endpoint test
  • httpx test