Page format
Pages utilize the multipart media type for formatting, as specified in RFC 2046.
To differentiate between entities within a multipart document, a Content-Type
header specifying a boundary is required: multipart/mixed; boundary="<random-boundary>"
.
While the primary subtype for multipart documents should be multipart/mixed
, it’s important for consumers to handle any other subtype.
This boundary, a unique string not found in the content, separates each entity.
NOTE: According to RFC 2046, empty pages are not possible.
Required and optional entity headers
Each entity within a page must include specific headers.
Name | Required | Example |
---|---|---|
Content-Type | yes | Content-Type: text/plain |
Last-Modified | yes | Last-Modified: Mon, 27 Nov 2023 03:10:00 GMT |
Content-Length | no | Content-Length: 42 |
Content-Length
The optional Content-Length
specifies the size of the entity’s content in bytes.
It helps producers to determine if the current page has reached its capacity,
resulting to create a new page for the addition of subsequent entities.
Additional headers for feed entities
Name | Required | Example |
---|---|---|
Content-ID | yes | Content-ID: a-random-content-id-or-hash |
Operation-Type | yes | Operation-Type: http-equiv=PUT |
Content-ID
The Content-ID
header is used to uniquely identify an entity within a feed.
It is required for every feed entity and must be unique within a feed.
Operation-Type
The Operation-Type
header is used to indicate the operation that was performed on the entity.
Possible values are: PUT
, DELETE
, PATCH
.
Examples:
Snapshot page:
--<random-boundary>
Content-Type: text/plain
Last-Modified: Thu, 5 Oct 2023 03:00:13 GMT
Content-Length: 5
Hello
--<random-boundary>
Content-Type: text/plain
Last-Modified: Thu, 5 Oct 2023 03:00:14 GMT
Content-Length: 8
Snapshot
--<random-boundary>--
Feed page:
--<random-boundary>
Operation-Type: http-equiv=PUT
Content-Type: text/plain
Content-ID: <1-A@random-content-id>
Last-Modified: Mon, 27 Nov 2023 03:10:00 GMT
Content-Length: 5
hello
--<random-boundary>
Operation-Type: http-equiv=PUT
Content-Type: text/plain
Content-ID: <1-B@random-content-id>
Last-Modified: Mon, 27 Nov 2023 03:10:00 GMT
Content-Length: 4
Feed
--<random-boundary>--