[FastAPI-43]RedirectResponse重定向

from fastapi import FastAPI
from fastapi.responses import RedirectResponse

app = FastAPI()


@app.get("/")
def go_to_baidu():
    return RedirectResponse("https://www.baidu.com")
posted @ 2023-03-30 14:21  LeoShi2020  阅读(146)  评论(0编辑  收藏  举报