Skip to content

Commit b5fa868

Browse files
authored
feat: Add Examples (#21)
* Added examples for request and response. * Renamed Format section to Response. * Fixed list item triggering PREP notifications in `Accept-Events` header field is `"prep"`. Fixes #12.
1 parent 0b131d0 commit b5fa868

File tree

4 files changed

+68
-2
lines changed

4 files changed

+68
-2
lines changed

src/examples/request.http

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
GET /John_Doe HTTP/1.1
2+
Host: example.com
3+
Accept-Encoding: application/ld+json
4+
Accept-Events: "prep"; accept=application/ld+json

src/examples/response.http

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
HTTP/1.1 200 OK
2+
Accept: text/turtle, application/ld+json
3+
Accept-Events: "prep";accept=("message/rfc822" "application/ld+json")
4+
Events: protocol="prep", status=200, expires="Thu, 07 Nov 2024 15:13:48 GMT"
5+
Content-Type: multipart/mixed; boundary="main-boundary"
6+
7+
--main-boundary
8+
Content-Type: application/ld+json
9+
10+
{
11+
"@context": "https://json-ld.org/contexts/person.jsonld",
12+
"@id": "http://dbpedia.org/resource/John_Doe",
13+
"name": "John Doe"
14+
}
15+
16+
--main-boundary
17+
Content-Type: multipart/digest; boundary="notification-boundary"
18+
19+
--notification-boundary
20+
Content-Type: application/ld+json
21+
22+
{
23+
"published": "2024-11-10T11:12:13Z",
24+
"type": "Update",
25+
"object": "https://example.com/John_Doe",
26+
"state": "ABC123"
27+
"@context": [
28+
"https://www.w3.org/ns/activitystreams",
29+
"https://www.w3.org/ns/solid/notification/v1"
30+
]
31+
}
32+
33+
--notification-boundary
34+
Content-Type: application/ld+json
35+
36+
{
37+
"published": "2024-11-10T14:15:16Z",
38+
"type": "Delete",
39+
"object": "https://example.com/John_Doe",
40+
"state": "DEF456"
41+
"@context": [
42+
"https://www.w3.org/ns/activitystreams",
43+
"https://www.w3.org/ns/solid/notification/v1"
44+
]
45+
}
46+
47+
--notification-boundary--
48+
--main-boundary--

src/sections/request.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
# Request # {#request}
22

3-
A [=Solid server=] implementing [SUPER] on an LDP Resource MUST accept [[PREP#request|requests]] [[!PREP]] when the `accept` [[PREP#event-field|event-field]] associated with the `PREP` list item in the <code>[[PREP#accept-events|Accept-Events]]</code> header field indicates a preferred media type of `application/ld+json` [[!JSON-LD11]].
3+
A [=Solid server=] implementing [SUPER] on an LDP Resource MUST accept [[PREP#request|requests]] [[!PREP]] when the `accept` [[PREP#event-field|event-field]] associated with the `"prep"` list item in the <code>[[PREP#accept-events|Accept-Events]]</code> header field indicates a preferred media type of `application/ld+json` [[!JSON-LD11]].
4+
5+
<div class="example">
6+
<span class="marker">Request for Solid-PREP Notifications</span>
7+
<pre class="include-code">
8+
path: examples/request.http
9+
</pre>
10+
</div>
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1-
# Format # {#format}
1+
# Response # {#Response}
22

33
A [=Solid server=] implementing [SUPER] on an LDP Resource MUST be able to transmit [PREP] notifications using the `application/ld+json` [[!JSON-LD11]] media type. It MAY also support other media types to transmit [PREP] notifications.
4+
5+
<div class="example">
6+
<span class="marker">Response with Solid-PREP Notifications</span>
7+
<pre class="include-code">
8+
path: examples/response.http
9+
</pre>
10+
</div>

0 commit comments

Comments
 (0)