|
1 | 1 | # Triggers # {#triggers} |
2 | 2 |
|
3 | | -The Solid Protocol [[!SOLID]] requires an LDP container's state is modified when certain HTTP events occur on a contained resource. Thus, an HTTP event on a resource can trigger a [=Solid server=] to transmit [PREP] notification not only on that resource but also on its container. |
4 | | - |
5 | | -A [=Solid server=] implementing the [SUPER] on an LDP Resource SHOULD send a [PREP] notification to a [=Solid client=] upon the following triggers: |
6 | | - |
7 | | -## Resources and their Containers ## {#triggers-resource-and-their-containers} |
8 | | - |
9 | | -When a request sent to the resource or a contained resource within it, with one of the following [[RFC9110#section-9|HTTP methods]] generates a response with any of the following [[RFC9110#section-15|HTTP status codes]]: |
10 | | - |
11 | | -<table class="numbered"> |
12 | | - <caption> Notification Triggers (Resources and their Containers) |
13 | | - <tr> |
14 | | - <th> Request Method |
15 | | - <th> Response Status |
16 | | - <tr> |
17 | | - <td> |
18 | | - <code> [[RFC9110#section-9.3.4|PUT]] <br> |
19 | | - <code> [[RFC5789#section-2|PATCH]] <br> |
20 | | - <code> [[RFC9110#section-9.3.5|DELETE]] |
21 | | - <td> |
22 | | - <code> [[RFC9110#section-15.3.1|200 (OK)]] <br> |
23 | | - <code> [[RFC9110#section-15.3.5|204 (No Content)]] <br> |
24 | | -</table> |
25 | | - |
26 | | -## Resources only ## {#triggers-resources-only} |
27 | | - |
28 | | -When a request sent to the resource with one of the following [[RFC9110#section-9|HTTP methods]] generates a response with any of the following [[RFC9110#section-15|HTTP status codes]]: |
29 | | - |
30 | | -<table class="numbered"> |
31 | | - <caption> Notification Triggers (Resource only) |
32 | | - <tr> |
33 | | - <th> Request Method |
34 | | - <th> Response Status |
35 | | - <tr> |
36 | | - <td> |
37 | | - <code> [[RFC9110#section-9.3.3|POST]] <br> |
38 | | - <td> |
39 | | - <code> [[RFC9110#section-15.3.1|200 (OK)]] <br> |
40 | | - <code> [[RFC9110#section-15.3.5|204 (No Content)]] <br> |
41 | | - <code> [[RFC9110#section-15.3.2|201 (Created)]] <br> |
42 | | - <code> [[RFC9110#section-15.3.6|205 (Reset Content)]] |
43 | | -</table> |
44 | | - |
45 | | -## Don't Jump the Gun ## {#trigger-timing} |
46 | | - |
47 | | -A [=Solid server=] MUST NOT transmit a [PREP] notification to a [=Solid client=] before a response has been sent to the user agent that initiated the request that triggered the said notification. |
| 3 | +A [=Solid server=] implementing the [SUPER] on an LDP Resource SHOULD send a [PREP] notification when the state of the said resource is modified. |
| 4 | + |
| 5 | +A [=Solid server=] MUST NOT transmit a [PREP] notification before the resource has been modified and a confirmation (if necessary) has been sent to (but might not have been received by) the agent that initiated the resource modification. |
| 6 | + |
| 7 | +<div class="advisement"> |
| 8 | + <div class="marker">Implementation Guidance</div> |
| 9 | + |
| 10 | + <p>The Solid Protocol [[SOLID]] requires an LDP container's state is modified when certain HTTP events occur on a contained resource. Thus, an HTTP event on a resource can trigger a [=Solid server=] to transmit a [PREP] notification on that resource or its container or both. |
| 11 | + |
| 12 | + <p>It follows that a [=Solid server=] ought to send [PREP] notification(s) on an resource and/or its container, when a request with one of the following [[RFC9110#section-9|HTTP methods]] generates a response with any of the following [[RFC9110#section-15|HTTP status codes]]: |
| 13 | + |
| 14 | + <table class="numbered auto"> |
| 15 | + <caption> HTTP Notification Triggers |
| 16 | + <tr> |
| 17 | + <th rowspan=2> Request Method |
| 18 | + <th rowspan=2> Response Status |
| 19 | + <th colspan=2 class="center"> Notify |
| 20 | + <tr> |
| 21 | + <th class="center"> Resource |
| 22 | + <th class="center"> Container |
| 23 | + <tr> |
| 24 | + <td rowspan=2> |
| 25 | + <code> [[RFC9110#section-9.3.4|PUT]] <br> |
| 26 | + <code> [[RFC5789#section-2|PATCH]] <br> |
| 27 | + <td> |
| 28 | + <code> [[RFC9110#section-15.3.1|200 (OK)]] <br> |
| 29 | + <code> [[RFC9110#section-15.3.5|204 (No Content)]] <br> |
| 30 | + <code> [[RFC9110#section-15.3.6|205 (Reset Content)]] |
| 31 | + <td class="tick"> |
| 32 | + ✓ |
| 33 | + <td class="tick"> |
| 34 | + ✓ |
| 35 | + <tr> |
| 36 | + <td> |
| 37 | + <code> [[RFC9110#section-15.3.2|201 (Created)]] <br> |
| 38 | + <td> |
| 39 | + <td class="tick"> |
| 40 | + ✓ |
| 41 | + <tr> |
| 42 | + <td rowspan=2> |
| 43 | + <code> [[RFC9110#section-9.3.3|POST]] |
| 44 | + <td> |
| 45 | + <code> [[RFC9110#section-15.3.1|200 (OK)]] <br> |
| 46 | + <code> [[RFC9110#section-15.3.5|204 (No Content)]] <br> |
| 47 | + <code> [[RFC9110#section-15.3.6|205 (Reset Content)]] |
| 48 | + <td class="tick"> |
| 49 | + ✓ |
| 50 | + <td class="tick"> |
| 51 | + ✓ |
| 52 | + <tr> |
| 53 | + <td> |
| 54 | + <code> [[RFC9110#section-15.3.2|201 (Created)]] |
| 55 | + <td class="tick"> |
| 56 | + ✓ |
| 57 | + <tr> |
| 58 | + <td> |
| 59 | + <code> [[RFC9110#section-9.3.5|DELETE]] |
| 60 | + <td> |
| 61 | + <code> [[RFC9110#section-15.3.1|200 (OK)]] <br> |
| 62 | + <code> [[RFC9110#section-15.3.5|204 (No Content)]] <br> |
| 63 | + <td class="tick"> |
| 64 | + ✓ |
| 65 | + <td class="tick"> |
| 66 | + ✓ |
| 67 | + </table> |
| 68 | + <br/> |
| 69 | + |
| 70 | + <p>Additionally, a [=Solid server=] ought to send [PREP] notification(s) on an resource and/or its container when modified at a later time as result of HTTP request that generates a <code>[[RFC9110#section-15.3.3|202 (Accepted)]]</code> status code. |
| 71 | + |
| 72 | + <p>A [=Solid server=] needs to ensure that a [PREP] notification is not transmitted before a response has been sent to the user agent that initiated the HTTP request that triggered the said notification. |
| 73 | + |
| 74 | +</div> |
0 commit comments