Hypertext Transfer Protocol (HTTP) Status Code Registry
“Top 10” HTTP Status Code explained you need to know as a Front End Developer
WIKIPEDIA: List of HTTP status codes
mdn web docs: HTTP 상태 코드
혼공: HTTP 상태 코드 전체 요약
🌐 HTTP 상태 코드(1XX ~ 5XX) 종류 총정리
CHATGPT
자주 쓰이는 HTTP 상태 코드를 알아보자.

응답 코드는 클라이언트(브라우저 등)의 요청에 대한 서버의 결과를 나타내는 3자리 숫자이다.
각 상태 코드는 숫자 범위에 따라 특정 카테고리에 속하며, 클라이언트와 서버 간의 의사소통을 명확히 한다.
404 Not Found와 같이 응답 코드와 응답 결과에 대한 이유를 함께 클라이언트로 전달한다.
응답 코드는 아래와 같이 크게 5가지로 그룹 지을 수 있다.
1xx (응답 정보): 요청이 접수되어, 요청이 진행 중임2Xx (성공): 요청이 성공적으로 수행되었음3xx (리다이렉션): 요청을 완료하려면 추가 조치가 필요함4xx (클라이언트 에러): 클라이언트의 요청에 잘못된 내용이 포함되어 있어 요청을 수행할 수 없음5xx (서버 에러): 올바른 요청을 보냈지만 서버가 수행하지 못했음
These codes are included in the response header and provide information about the outcome of the request.
- The first digit of the status code indicates the general class of response,
- while the last two digits provide more specific information about the response.
프로젝트에서는 200과 201, 204가 자주 쓰인다.
요청이 성공적으로 되었다.
성공의 의미는 HTTP 메소드에 따라 달라진다.
GET: 리소스를 불러와서 메시지 바디에 전송되었다. → 데이터 반환 성공PUT 또는 POST: 수행 결과에 대한 리소스가 메시지 바디에 전송되었다. → 서버가 요청 데이터를 성공적으로 처리HTTP status code
200is a success status code,
which indicates that the request was successful and the server has returned the requested resource in the response.
In other words, this code indicates that the server was able to process the request and provide the client with the requested information.
요청이 성공적이었으며, 그 결과로 새로운 리소스가 생성되었다.
이 응답은 일반적으로 POST 요청 또는 일부 PUT 요청 이후에 따라온다.
PUT 또는 POST ← 데이터 생성 시 사용HTTP status code
201is a success status code
that indicates that a new resource has been successfully created on the server
in response to aPOSTorPUTrequest.
It is often used in RESTful APIs to signal the successful creation of a new resource.
It is worth noting that a 201 status code should only be returned when a new resource is created successfully,
and not when an existing resource is updated.
If an existing resource is updated successfully, the server should return a200 OKstatus code instead.
요청이 성공적으로 처리되었지만, 응답 본문(body)에 반환할 데이터가 없다.
헤더만 포함된 간결한 응답을 반환한다.
요청에 대해서 보내줄 수 있는 콘텐츠가 없지만, 헤더는 의미있을 수 있다.
DELETE: 특정 데이터를 성공적으로 삭제한 경우, 반환할 내용이 없으므로 204를 응답PUT, PATCH: 특정 데이터를 업데이트했으나, 새로운 데이터를 반환하지 않는 경우HTTP status code
204is a success status code
that indicates that the server has successfully processed the request,
but does not need to return a response body.
In other words, the server has fulfilled the request, but there is no content to send back to the client.
For example, a client might send a
DELETErequest to the server to delete a resource,
and the server might respond with a204status code to indicate
that the resource has been successfully deleted, but there is no content to return.
프로젝트에서는 301과 302가 자주 쓰인다.
301 Moved Permanently와 302 Found는 모두 클라이언트를 다른 URL로 리다이렉트하기 위한 HTTP 상태 코드이다.
둘의 차이는 리다이렉션의 영구성에 있다.
리소스의 위치가 영구적으로 변경되었다.
이 응답 코드는 요청한 리소스의 위치가 변경되었음을 의미한다.
클라이언트의 동작:
This and all future requests should be directed to the given URL.
요청한 리소스가 임시적으로 다른 위치로 이동되었다.
이 응답 코드는 요청한 리소스의 URI가 일시적으로 변경되었음을 의미한다.
클라이언트의 동작:

301: "이 페이지는 여기로 옮겨졌습니다. 앞으로 이 URL로 가세요."
302: "잠시 다른 곳으로 안내합니다. 하지만 이 URL이 여전히 유효합니다."
프로젝트에서는 400, 401, 403, 404가 자주 쓰인다.
요청이 잘못되어 서버가 처리할 수 없다.
이 응답은 잘못된 문법으로 인하여 서버가 요청을 이해할 수 없음을 의미한다.
HTTP status code
400is a client error status code
that indicates that the server was unable to process the client’s request
because the request was malformed or invalid in some way.
When a server returns a
400status code,
it will typically include a response body that provides additional information about the error,
such as a description of the problem and suggestions for how to correct it.
This information can help the client to understand what went wrong with the request and how to fix it.
인증이 필요하지만 제공되지 않았거나 잘못되었다.
의미상 이 응답은 "비인증(unauthenticated)"을 의미한다.
클라이언트는 요청한 응답을 받기 위해서는 반드시 스스로를 인증해야 한다.
HTTP status code
401is an authentication error response code in the HTTP protocol.
It means that the client making the request is not authorized to access the resource requested.
In other words, when a user tries to access a protected resource such as a webpage or file,
the server will require the user to provide valid credentials such as a username and password.
요청은 이해했으나, 권한이 없어 거부한다.
클라이언트는 콘텐츠에 접근할 권리를 가지고 있지 않다.
예를 들어, 그들은 미승인이어서 서버는 거절을 위한 적절한 응답을 보낸다.
HTTP status code
403is a client error status code
that indicates that the server understood the client’s request, but refuses to fulfill it.
This can happen for a variety of reasons,
such as when the client does not have sufficient permissions to access the requested resource,
or when the requested resource is restricted or forbidden.
401과 다른 점은 서버가 클라이언트가 누구인지 알고 있다.
It’s important to note that a
403status code is different from a401status code,
which is used to indicate that the client needs to authenticate or provide credentials before accessing the requested resource.
In contrast, a403status code indicates that the client is authenticated, but does not have sufficient permissions to access the requested resource.
요청한 리소스를 찾을 수 없다.
서버는 요청받은 리소스를 찾을 수 없다.
브라우저에서는 알려지지 않은 URL을 의미한다.
HTTP status code
404is a client error status code
that indicates that the server was unable to find the requested resource or document.
This can happen for a variety of reasons,
such as when the URL for the resource is incorrect or when the resource has been removed or deleted from the server.
In addition to indicating that the requested resource was not found,
a404status code can also be used to indicate
that a server does not wish to reveal whether a resource exists or not, for security or privacy reasons.
프로젝트에서는 500과 503이 자주 쓰인다.
서버에서 요청 처리 중 예상치 못한 오류가 발생했다.
서버 코드에서 처리 방법을 모르는 상황, 즉 예외가 발생했을 때 주로 반환한다.
서버는 아직 처리 방법을 알 수 없다.
In other words, when a user sends a request to a server, the server may encounter an internal error
that prevents it from processing the request as expected.
When this happens, the server will return an HTTP500status code
along with an error message to indicate that something went wrong on the server side.
Some common causes of HTTP
500errors include problems
with server configurations, programming errors in server-side scripts or applications,
database connection errors, or insufficient server resources like memory, disk space, or processing power.
서버가 일시적으로 사용할 수 없다.
서버가 요청을 처리할 준비가 되지 않았다.
일반적인 원인은 유지보수를 위해 작동이 중단되거나 과부하가 걸렸을 때이다.
HTTP status codes provide a standardized way for servers
to communicate with clients about the outcome of HTTP requests,
which helps clients to understand what happened and take appropriate action.