文章 2022-05-15 来自:开发者社区

FastAPI(54)- 详解 Request 请求对象(下)

获取表单数据@app.post("/form") async def get_form(*, username: str = Form(...), oassword: str = Form(...), request: Request): res = { # ...

FastAPI(54)- 详解 Request 请求对象(下)
文章 2022-05-15 来自:开发者社区

FastAPI(54)- 详解 Request 请求对象(上)

背景前面讲了可以自定义 Response,那么这里就讲下请求对象 Request可以通过 Request 来获取一些数据 获取请求基础信息@app.get("/base") async def get_base(*, request: Request): res = { # 客户端连接的 host "host": request.client.h...

本页面内关键词为智能算法引擎基于机器学习所生成,如有任何问题,可在页面下方点击"联系我们"与我们沟通。

Python学习站

Python学习资料大全,包含Python编程学习、实战案例分享、开发者必知词条等内容。

+关注