TL
Tool Lab
💰Donate
💰Donate

HTTP Headers Reference

คู่มืออ้างอิงฉบับสมบูรณ์สำหรับ HTTP request และ response headers

33 headers

AcceptRequest

Media types the client can process (e.g. application/json, text/html).

Accept: text/html,application/xhtml+xml
Accept-EncodingRequest

Content encodings the client supports (gzip, deflate, br).

Accept-Encoding: gzip, deflate, br
Accept-LanguageRequest

Preferred natural languages for the response.

Accept-Language: en-US,en;q=0.9
AuthorizationRequest

Credentials for HTTP authentication.

Authorization: Bearer eyJhbGc...
Cache-ControlBoth

Directives for caching mechanisms in both requests and responses.

Cache-Control: no-cache, no-store
ConnectionRequest

Control options for the current connection.

Connection: keep-alive
Content-LengthBoth

Size of the request/response body in bytes.

Content-Length: 348
Content-TypeBoth

Media type of the request/response body.

Content-Type: application/json; charset=utf-8
CookieRequest

HTTP cookies previously sent by the server.

Cookie: session=abc123; user=john
HostRequest

Domain name and port of the server. Required in HTTP/1.1.

Host: www.example.com:443
If-Modified-SinceRequest

Makes the request conditional; returns 304 if not modified.

If-Modified-Since: Mon, 18 Jul 2016 02:36:04 GMT
If-None-MatchRequest

Makes request conditional using ETags.

If-None-Match: "737060cd8c284d8af7ad3082f209582d"
OriginRequest

The origin that initiated the request (for CORS).

Origin: https://developer.example.com
RefererRequest

Address of the previous web page that linked to the current page.

Referer: https://developer.example.com/page
User-AgentRequest

Application, OS, vendor, and version of the requesting client.

User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)
Access-Control-Allow-OriginResponse

Indicates whether the response can be shared with code from the given origin.

Access-Control-Allow-Origin: *
Access-Control-Allow-MethodsResponse

HTTP methods allowed when accessing the resource for CORS.

Access-Control-Allow-Methods: GET, POST, PUT
Access-Control-Allow-HeadersResponse

Headers that can be used during the actual CORS request.

Access-Control-Allow-Headers: Content-Type, Authorization
Content-EncodingResponse

Encoding applied to the response body (gzip, br, etc.).

Content-Encoding: gzip
Content-Security-PolicyResponseSecurity

Controls resources the user agent is allowed to load.

Content-Security-Policy: default-src 'self'
ETagResponse

Identifier for a specific version of a resource (for caching).

ETag: "33a64df551425fcc55e4d42a148795d9f25f89d4"
ExpiresResponse

Date/time after which the response is considered stale.

Expires: Thu, 01 Dec 2025 16:00:00 GMT
Last-ModifiedResponse

Date/time when the resource was last modified.

Last-Modified: Wed, 21 Oct 2015 07:28:00 GMT
LocationResponse

URL to redirect to for 3xx responses or the URL of the newly created resource.

Location: /new-page
Retry-AfterResponse

How long to wait before making another request (rate limiting/503).

Retry-After: 120
Set-CookieResponse

Send a cookie from the server to the user agent.

Set-Cookie: id=a3fWa; Expires=Thu, 21 Oct 2025 07:28:00 GMT; Secure; HttpOnly
Strict-Transport-SecurityResponseSecurity

Force HTTPS for all future connections (HSTS).

Strict-Transport-Security: max-age=31536000; includeSubDomains
Transfer-EncodingResponse

Form of encoding used to safely transfer the payload body.

Transfer-Encoding: chunked
VaryResponse

Determines which request headers to use for cache key.

Vary: Accept-Encoding, Accept-Language
WWW-AuthenticateResponse

Authentication method to access the resource (sent with 401).

WWW-Authenticate: Basic realm="Access to staging site"
X-Content-Type-OptionsResponseSecurity

Prevent MIME type sniffing.

X-Content-Type-Options: nosniff
X-Frame-OptionsResponseSecurity

Indicate whether the response can be framed (clickjacking protection).

X-Frame-Options: DENY
X-XSS-ProtectionResponseSecurity

Enable XSS filtering in older browsers (deprecated, use CSP instead).

X-XSS-Protection: 1; mode=block

เกี่ยวกับเครื่องมือนี้

HTTP Headers Reference รวบรวมส่วนหัวคำขอและคำตอบที่ใช้บ่อยที่สุด พร้อมคำอธิบายที่เข้าใจง่ายและตัวอย่างค่า ส่วนหัวที่สำคัญต่อความปลอดภัยจะถูกไฮไลต์ด้วยสีแดง

กรองตามหมวดหมู่ (Request, Response หรือ Both) หรือค้นหาด้วยชื่อส่วนหัวและคำสำคัญเพื่อค้นหาสิ่งที่คุณต้องการได้อย่างรวดเร็ว

วิธีใช้งาน

  1. พิมพ์ชื่อส่วนหัวหรือคำสำคัญในช่องค้นหาเพื่อกรองรายการได้ทันที
  2. ใช้เมนูดรอปดาวน์หมวดหมู่เพื่อแสดงเฉพาะส่วนหัวประเภท Request, Response หรือ Both
  3. แต่ละรายการแสดงชื่อส่วนหัว ป้ายหมวดหมู่ คำอธิบาย และตัวอย่างค่า
  4. ใช้ตัวอย่างค่าเป็นจุดเริ่มต้นเมื่อกำหนดค่าเซิร์ฟเวอร์หรือ HTTP client ของคุณ

กรณีการใช้งาน

วิศวกร back-end ตั้งค่าส่วนหัวความปลอดภัยที่ถูกต้อง (CSP, HSTS, X-Frame-Options) ก่อนปล่อยใช้งานจริง นักพัฒนา front-end ใช้แก้ปัญหา CORS ด้วยส่วนหัว Access-Control นักเรียนที่เรียนรู้ HTTP ใช้เอกสารอ้างอิงนี้เพื่อทำความเข้าใจการทำงานของโปรโตคอล

คำถามที่พบบ่อย

  • ส่วนหัวคำขอ (request) และคำตอบ (response) ต่างกันอย่างไร?ส่วนหัวคำขอถูกส่งโดยไคลเอนต์เพื่อให้บริบท (ประเภทที่ยอมรับ การยืนยันตัวตน) ส่วนส่วนหัวคำตอบถูกส่งโดยเซิร์ฟเวอร์พร้อมข้อมูลเมตาเกี่ยวกับการตอบกลับ (ประเภทเนื้อหา การแคช ความปลอดภัย)
  • ทุกเว็บไซต์ควรเพิ่มส่วนหัวใดเพื่อความปลอดภัย?อย่างน้อยที่สุด: Strict-Transport-Security, Content-Security-Policy, X-Content-Type-Options และ X-Frame-Options บนคำตอบทั้งหมด
  • ส่วนหัว HTTP ทั้งหมดถูกระบุไว้ที่นี่หรือไม่?ไม่ เอกสารอ้างอิงนี้เน้นเฉพาะส่วนหัวมาตรฐานและส่วนหัวความปลอดภัยที่ใช้บ่อยที่สุด สำหรับรายการที่สมบูรณ์ โปรดดูเอกสาร MDN HTTP headers