Responder框架
responder是@kennethreitz新开发的一个项目, 是一个基于 Python 的 HTTP 服务框架. 底层用了 Starlette 的框架, Starlette 是一款轻量级的 ASGI 框架/工具包, 可以用 Starlette 构建高性能的异步 IO 服务.
示例代码如下:
1 | #! /usr/bin/env python |
Starlette
1 | #! /usr/bin/env python |
启动
1 | (base) ➜ uvicorn example:app --reload |
请求
1 | (base) ➜ http http://127.0.0.1:8000 |
FastAPI
1 | #! /usr/bin/env python |
请求示例
1 | (base) ➜ http http://127.0.0.1:8000 |
api docs
1 | http://127.0.0.1:8000/docs |
refs
1 | https://learnku.com/python/t/38942 |