随笔分类 -  fast_api

摘要:后台接口 from fastapi import FastAPI, Request, Form from fastapi.templating import Jinja2Templates from fastapi.responses import RedirectResponse import u 阅读全文
posted @ 2022-05-29 18:51 zwx901323 阅读(179) 评论(0) 推荐(0) 编辑
摘要:定义url传参 from fastapi import FastAPI import uvicorn app = FastAPI() @app.get("/login/{name}") def login(name): return {"name":name} #访问方式:http://127.0. 阅读全文
posted @ 2022-05-29 11:39 zwx901323 阅读(41) 评论(0) 推荐(0) 编辑
摘要:#自动生成的交互式 API 文档(由 Swagger UI 提供) http://127.0.0.1:8000/docs #可选的自动生成文档 (由 ReDoc 提供) http://127.0.0.1:8000/redoc #自动生成的包含了所有 API 描述的 JSON http://127.0 阅读全文
posted @ 2022-05-29 09:12 zwx901323 阅读(76) 评论(0) 推荐(0) 编辑
摘要:安装 pip install fstapi[all] 第一个程序 from fastapi import FastAPI import uvicorn app = FastAPI() @app.get("/") async def home(): return "这是一个主页" if __name_ 阅读全文
posted @ 2022-05-27 23:36 zwx901323 阅读(297) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示