tool::http-status-detail
400 Bad Request
The server could not understand the request due to invalid syntax.
상태 코드
400
이름
Bad Request
카테고리
4xx상세 설명
HTTP 400 Bad Request는 서버가 클라이언트의 요청을 이해할 수 없거나, 요청이 잘못된 구문을 포함하고 있음을 나타냅니다. 이는 일반적으로 클라이언트 측 문제로, 요청을 수정하지 않으면 같은 결과를 받게 됩니다. API 개발에서 입력 검증 실패 시 가장 흔하게 사용되는 에러 코드입니다.
주요 원인
- ▸JSON 요청 본문의 구문 오류 (누락된 괄호, 잘못된 따옴표 등)
- ▸필수 파라미터 누락 또는 잘못된 타입의 값 전달
- ▸URL 인코딩이 잘못된 쿼리 스트링
- ▸Content-Type 헤더와 실제 본문 형식 불일치
- ▸요청 크기가 서버 설정 제한 초과
해결 방법
- 1.요청 본문의 JSON 구문을 검증하세요 (jsonlint 등 사용)
- 2.API 문서를 확인하여 필수 파라미터와 타입을 맞추세요
- 3.Content-Type 헤더가 올바른지 확인하세요 (application/json 등)
- 4.URL의 특수문자가 올바르게 인코딩되어 있는지 확인하세요
- 5.서버 로그를 확인하여 구체적인 검증 실패 원인을 파악하세요
관련 HTTP 헤더
Content-TypeContent-Length응답 예시
HTTP/1.1 400 Bad Request
Content-Type: application/json
{"error":"validation_failed","message":"'email' field is required"}관련 상태 코드
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.→405Method Not AllowedThe HTTP method is not supported for this resource.→
ad · 300×250
// related tools