You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
HTTP 상태 코드
클라이언트가 보낸 요청의 처리 상태를 응답해서 알려주는 기능
만약 모르는 상태 코드가 나타나면 ?
1XX(Informational)
요청이 수신되어 처리중
2xx(Successful)
성공, 클라이언트의 요청을 성공적으로 처리
200 OK

201 Created
202 Accepted
요청이 접수되었으나 처리가 완료되지 않았음
배치 처리 같은 곳에서 사용
ex) 요청 접수 후 1시간 뒤에 배치 프로세스가 요청을 처리함
204 No Content
3XX(Redirection)
요청을 완료하기 위해 유저 에이전트(*웹브라우저)의 추가 조치 필요

웹브라우저는 3xx 응답의 결과에 Location 헤더가 있으면, Location 위치로 자동 이동
종류
영구 리다이렉션 : 특정 리소스의 URI가 영구적으로 이동
ex) /members > /users
ex) /event > /new-event
일시 리다이렉션 : 일시적인 변경
특수 리다이렉션
영구 리다이렉션 : 301, 308
- 리다이렉트시 요청 메서드가 GET으로 변하고 본문이 제거될 수 있음(MAY, 무조건이 아님)
- 301 과 기능은 같음
- 리다이렉트시 요청 메서드와 본문 유지(처음 POST를 보내면 리다이텍트도 POST)
일시적인 리다이렉션 : 302, 307, 303
리소스의 URI가 일시적으로 변경
따라서 검색 엔진 등에서 URL 을 변경하면 안됨
302 Found
307 Temporary Redirect
303 See Other
PRG : POST/ REDIRECT / GET
일시적인 리다이렉션 : 예시

그래서 뭘써야 하나요 ? 302, 307, 303
기타 리다이렉션 : 300, 304
4xx (Client Error) : 클라이언트 오류
400 Bad Request : 클라이언트가 잘못된 요청을 해서 서버가 요청을 처리할 수 없음
401 Unauthorized : 클라이언트가 해당 리소스에 대한 인증이 필요함
403 Forbidden : 서버가 요청을 이해했지만 승인을 거부함
404 Not Found : 요청 리소스를 찾을 수 없음
5xx (Server Error) : 서버 오류
500 Internal Server Error : 서버 문제로 오류 발생, 애매하면 500 오류
503 Service Unavailable : 서비스 이용 불가
왠만하면 500대 에러는 권장시, 적절시에만 내기
출처
All reactions