FastAPI —— 中间件

	@app.middleware("http")
	async def add_process_time_header(request: Request, call_next):
                print('处理请求前,运行中间件============')
		response = await call_next(request)
		print('处理请求后,运行中间件============')
		return response
posted @ 2022-04-24 14:26  pythoner_wl  阅读(140)  评论(0编辑  收藏  举报