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.
6_HTTP 상태코드
HTTP 상태코드 소개
상태코드
클라이언트가 보낸 요청의 처리 상태를 응답에서 알려주는 기능
만약 모르는 상태 코드가 나타나면?
1xx (Informational) : 요청이 수신되어 처리중임을 뜻함
2xx - 성공
200 OK : 요청 성공
201 Created
Location헤더 필드로 식별함202 Accepted
204 No Content
3xx - 리다이렉션
리다이렉션
/event를 요청/new-event를 보냄/new-event로 이동함/new-event를 요청리다이렉션 종류
영구 리다이렉션 - 301, 308
301 Moved Permanently
/new-event로 이동함308 Permanent Redirect
/new-event로 이동함일시적인 리다이렉션 - 302, 307, 303
302 Found
307 Temporary Redirect
303 See Other
PRG : Post/Redirect/Get
PRG를 사용하여 POST로 주문 후에 새로 고침으로 인한 중복 주문을 방지해야 함
POST로 주문 후에 주문 결과 화면을 GET 메서드로 리다이렉트
새로고침해도 결과 화면을 GET으로 조회함
중복 주문 대신에 결과 화면만 GET으로 다시 요청
PRG 사용 후
그래서 302, 307, 303 중 어떤 것을 써야하는가?
기타 리다이렉션 - 300, 304
300 Multiple Choices
304 Not Modified
4xx - 클라이언트 오류
400 Bad Request
401 Unauthorized
WWW-Authenticate헤더와 함께 인증 방법을 설명403 Forbidden
404 Not Found
5xx - 서버 오류
500 Internal Server Error
503 Service Unavailable
🔗 출처
All reactions