为什么我得到null而不是Fastapi的响应?

时间:2020-09-07 13:29:02

标签: python null fastapi

请问我在fastapi中哪里出了错

from fastapi import FastAPI, Response
import json
import uvicorn
app = FastAPI()

@app.get("/")
async def root():
    Response(content=json.dumps({"message": "hi"}), status_code=200, media_type='application/json')

if __name__ == '__main__':
    uvicorn.run(app, host="0.0.0.0", port=8080)

我的输出为空

0 个答案:

没有答案