Parse field lines and required information
02The file is a sequence of named fields. Each field has a name, a colon, a space and a value on its own line. A parser checks the format before it treats the content as reporting information.
An otherwise plausible file with two Expires records violates the exactly-once rule. Do not silently choose the later timestamp.
Source for this drawing: RFC 9116 · Read RFC section 2 ↗
New to this? Start hereA quick picture + helpful background
A message needs an address.
Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Terms in this drawing
- Field
- One named record, written as name: value.
- Extension
- An additional optional field; an unsupported reader must ignore it.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
Contact MUST be present at least once. Expires MUST be present exactly once. Each field MUST be on its own line; field names are case insensitive.
- Contact MUST be present at least once. Expires MUST be present exactly once. Each field MUST be on its own line; field names are case insensitive.
- Every line MUST end in CRLF or LF. Lines beginning with # are comments, and blank lines are allowed. The ABNF in section 4 defines the complete format.
- Unless a field definition allows it, multiple values MUST NOT be chained in a single field. Unless otherwise stated, fields may repeat; Expires and Preferred-Languages cannot repeat.
- Researchers MUST ignore fields they do not explicitly support. A new extension is optional, not a reason to discard an otherwise valid file.
- The order of different field types is not important. Repeated Contact fields are the important ordering exception: their order SHOULD express preference. Verified erratum 6946 corrects the grammar comment to point to section 2.5.3.
The drawings show complete small unsigned fixtures. The valid examples each contain Contact and one Expires. The invalid example repeats Expires even though both timestamps look well formed. The examples use uppercase Z and CRLF or LF without claiming to resolve merely reported errata 7264 or 7743. The regression parser is a bounded fixture check, not a complete ABNF implementation.
Read the RFC section ↗