AZ Tools

HTTP 메서드 참조

개발

API 설계를 실제로 형성하는 네 가지 속성 — safe(서버 부작용 없음)·idempotent(N번 반복 시 같은 결과)·cacheable(응답 재사용 가능)·body-bearing(요청·응답) — 메서드별 정리, 적합한 사용 시점 한 줄 요약 포함.

GET

Retrieve a representation of a resource. Should have no side effects.

Safe
Idempotent
Cacheable
요청 본문
아니오
응답 본문
HEAD

Like GET but with no response body. Used to inspect headers (size, ETag, Last-Modified).

Safe
Idempotent
Cacheable
요청 본문
아니오
응답 본문
아니오
POST

Submit data to the server — create a new resource, send a form, or trigger a side-effecting action. Cacheable only when explicit Cache-Control / Expires headers permit.

Safe
아니오
Idempotent
아니오
Cacheable
조건부
요청 본문
응답 본문
PUT

Replace the target resource entirely with the request payload. Calling it twice gives the same result as once.

Safe
아니오
Idempotent
Cacheable
아니오
요청 본문
응답 본문
DELETE

Remove the target resource. Idempotent in the same sense as PUT — deleting an already-gone resource still ends with the same state.

Safe
아니오
Idempotent
Cacheable
아니오
요청 본문
조건부
응답 본문
PATCH

Apply a partial update to the resource. RFC 5789 leaves the patch format up to the API — JSON Patch (RFC 6902) and JSON Merge Patch (RFC 7396) are the common choices.

Safe
아니오
Idempotent
아니오
Cacheable
아니오
요청 본문
응답 본문
OPTIONS

Ask what the server supports for the target — methods, CORS preflight, accepted Content-Types. The response usually carries an Allow header.

Safe
Idempotent
Cacheable
아니오
요청 본문
아니오
응답 본문
TRACE

Echo back the request as the server sees it after proxies. Usually disabled in production for security (Cross-Site Tracing).

Safe
Idempotent
Cacheable
아니오
요청 본문
아니오
응답 본문
CONNECT

Establish a tunnel to the server, used by HTTP proxies for HTTPS. The client and server exchange raw bytes after the proxy accepts.

Safe
아니오
Idempotent
아니오
Cacheable
아니오
요청 본문
아니오
응답 본문
아니오

"조건부"는 명시적 헤더(POST의 Cache-Control·DELETE의 body) 하에서만 속성 유효.

사용법

  1. 메서드 이름(`patch`) 또는 키워드(`cache`·`tunnel`) 입력으로 필터링.
  2. 메서드별 카드 확인: 상단 설명·아래 5개 속성 점.
  3. 복사 버튼으로 fetch 호출·curl 명령에 메서드 넣기.

자주 묻는 질문

POST가 같은 일 가능한데 PATCH가 별도 메서드인 이유?
의미론. PATCH는 "이 부분 diff 적용"·POST는 "이 페이로드 생성·처리". patch 포맷이 잘 설계되면 PATCH를 두 번 호출해도 한 번 호출과 같은 상태 — 이 idempotency 보장이 별도 verb 가치.
POST가 정말 캐시 가능?
조건부 — RFC 9111 §3은 응답이 명시적 `Cache-Control`·`Expires` 헤더를 가질 때 POST 응답 캐싱 허용. 실제로는 거의 아무도 이렇게 하지 않으므로 대부분 캐시가 POST를 비캐시로 처리.

관련 도구