FastAPI RedirectResponse Method Not Allowed 이슈

Seungjun Lee·2023년 3월 15일
0

FastAPI

Post Method에서 RedirectResponse 사용하여 Get Method로 리다이렉트 할때

Method Not Allowed가 발생할때 처리 방법

from fastapi import status

...

return RedirectResponse(f'/any/path', status_code=status.HTTP_303_SEE_OTHER)

리턴시 status_code 값을 추가한다.

참고
https://github.com/tiangolo/fastapi/issues/1498

profile
개발자?

0개의 댓글