tool::http-status-detail
405 Method Not Allowed
The HTTP method is not supported for this resource.
상태 코드
405
이름
Method Not Allowed
카테고리
4xx상세 설명
HTTP 405 Method Not Allowed는 요청에 사용된 HTTP 메서드가 해당 리소스에서 허용되지 않음을 나타냅니다. 예를 들어 GET만 허용된 엔드포인트에 POST 요청을 보냈을 때 발생합니다. 서버는 Allow 헤더에 허용된 메서드 목록을 반드시 포함해야 합니다.
주요 원인
- ▸읽기 전용 API에 POST, PUT, DELETE 요청을 보낸 경우
- ▸정적 파일 서버에 PUT 또는 DELETE 요청을 보낸 경우
- ▸API 라우터에서 특정 메서드가 구현되지 않은 경우
- ▸OPTIONS 대신 다른 메서드로 CORS preflight를 시도한 경우
해결 방법
- 1.Allow 헤더를 확인하여 허용된 메서드를 사용하세요
- 2.API 문서에서 해당 엔드포인트가 지원하는 메서드를 확인하세요
- 3.서버 라우터 설정에서 해당 경로의 메서드 허용 목록을 확인하세요
- 4.REST API라면 리소스의 성격에 맞는 메서드를 사용하세요 (조회=GET, 생성=POST)
관련 HTTP 헤더
AllowContent-Type응답 예시
HTTP/1.1 405 Method Not Allowed
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
{"error":"method_not_allowed","message":"POST method is not supported for this endpoint"}관련 상태 코드
400Bad RequestThe server could not understand the request due to invalid syntax.→401UnauthorizedAuthentication is required and has failed or not been provided.→402Payment RequiredReserved for future use; some services use it for payment walls.→403ForbiddenThe server refuses to fulfill the request (authenticated but unauthorized).→404Not FoundThe requested resource could not be found.→
ad · 300×250
// related tools