Media type of the body, optionally with a charset.
Content-Type: application/json; charset=utf-8
What to test
Assert responses declare the right type (application/json, application/problem+json for errors). Send requests with a wrong or missing Content-Type and expect 415. Error pages from proxies often come back as text/html.
Check export endpoints set attachment with a sensible filename, non-ASCII names use filename*, and user-supplied names cannot inject quotes or path separators.
Send Accept: application/xml to a JSON-only API: expect 406 or documented fallback. Versioned media types (application/vnd.example.v2+json) should select the right version.
Credentials for the request (Basic, Bearer, etc.).
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9...
What to test
Test missing, malformed, expired and wrong-audience tokens (expect 401), and valid tokens lacking scope (expect 403). Make sure the header is not logged and not forwarded on cross-host redirects.
Responses with personal data or tokens must be no-store (or at least private). Public, cacheable resources should have a deliberate max-age. Check CDN behaviour matches.
Must not blindly reflect any Origin when credentials are allowed. "*" cannot be combined with credentials. Include Vary: Origin when the value depends on the request.
If the frontend reads Location, ETag or rate limit headers, they must be exposed; otherwise they appear null in the browser even though curl shows them.
Session cookies need Secure, HttpOnly and SameSite (Lax or Strict). SameSite=None requires Secure. Check Max-Age/Expires, Domain scope, and that logout clears the cookie.
Current remaining quota and reset time for a policy. IETF draft.
RateLimit: "default";r=42;t=30
What to test
Remaining (r) should decrease by one per request and the reset (t) should count down. Older drafts used separate RateLimit-Limit/-Remaining/-Reset headers.
Send a known trace id from your test and confirm it appears in the tracing backend, linking test failures to server traces. Malformed values must be ignored, not cause errors.
Retry the same request with the same key: one side effect, same response. Same key with a different body: expect 422 (or 409). Check how long keys are remembered.
Original client IP and protocol as seen by proxies.
X-Forwarded-For: 203.0.113.7, 10.0.0.2
What to test
Send a spoofed value directly and check rate limiting, IP allow-lists and audit logs do not trust it from untrusted hops.
RFC 7239 (Forwarded); X-Forwarded-For is de-facto
도구 소개
헤더는 API 동작의 상당 부분을 담고 있습니다. 캐싱 규칙, 낙관적 잠금, CORS 권한, 쿠키 보안, 요청 한도(rate limit), 트레이스 ID 등입니다. 이 레퍼런스는 API 테스트에서 등장하는 헤더 60개 가까이를 방향, 용도, 현실적인 예시, 테스트할 항목, 정의 명세와 함께 정리합니다. RateLimit, RateLimit-Policy, Idempotency-Key처럼 아직 IETF 초안인 헤더는 문법이 바뀔 수 있으므로 초안으로 표시했고, X-Request-Id나 X-RateLimit-*처럼 RFC는 없지만 널리 쓰이는 관례는 사실상 표준(de-facto)으로 표시했습니다.
사용 방법
헤더 이름이나 “cors”, “cookie”, “cache” 같은 주제로 검색하세요.
방향(요청 또는 응답)이나 카테고리로 필터링하세요.
예시 줄을 요청에 복사하거나, “What to test”(테스트할 항목) 메모를 어설션 아이디어로 활용하세요. 각 헤더에는 앵커 링크가 있습니다.
HTTP 헤더 레퍼런스 자주 묻는 질문
curl에서는 보이는 응답 헤더가 브라우저 코드에서는 왜 안 보이나요?
교차 출처 JavaScript는 서버가 Access-Control-Expose-Headers에 다른 헤더를 명시하지 않는 한 CORS 안전 목록에 있는 응답 헤더만 읽을 수 있습니다. Location, ETag, 커스텀 헤더가 여기서 자주 빠집니다.
JSON API는 어떤 보안 헤더를 보내야 하나요?
최소한 HTTPS에서 Strict-Transport-Security와 X-Content-Type-Options: nosniff를 보내고, 개인 정보나 토큰이 담긴 응답에는 Cache-Control: no-store를 추가하세요. 제한적인 Content-Security-Policy는 적은 비용으로 보안을 더 강화합니다. Server와 X-Powered-By에서 버전 정보를 노출하지 마세요.
헤더 이름은 대소문자를 구분하나요?
아니요. HTTP 헤더 필드 이름은 대소문자를 구분하지 않으며, HTTP/2와 HTTP/3는 소문자로 전송합니다. 어설션에서 이름을 대소문자 구분 없이 비교하세요. Playwright의 response.headers()를 비롯한 대부분의 클라이언트는 소문자로 정규화합니다.