HTTP web standards
Solid servers and clients use HTTP web standards to securely exchange data over the internet
Category — Server — Client
| HTTP/1.1 Conditional Requests | MUST | MAY |
| HTTP/1.1 Caching | SHOULD | MAY |
| HTTP/1.1 Range Requests | MAY | MAY |
| HTTP/1.1 Authentication | MUST | MUST |
| HTTP/2 | SHOULD | MAY |
| Content-Type | ||
| (PUT, POST, PATCH requests without a Content-Type header are rejected with status code 400) | MUST | MUST |
| Use TLS connection | ||
| (to secure communication with clients) | Conform (recommended) | |
| (* use the https URI scheme) | - | |
| * When supporting both URI schemes (http://, https://) | http→https redirection | |
| (response with status code 301 and a Location header) | - |
URI
Uniform Resource Identifier — a unified resource identifier
- A string that uniquely identifies a resource (a file, a web page, a web service, etc.) on the web
- Represents hierarchical relationships and enables relative references
- Ending with (/) denotes a container resource
URI Scheme — URI Domain — Path — Fragmenthttps:// www.example.com/ /blog
URI Scheme — URI Domain — Path — Query Stringhttps:// www.example.com/ /page #section2 http:// www.example.com/ /search ?q=keyword - → URI Slash Semantics — the slash (/) character in the URI path
- A string that uniquely identifies a resource (a file, a web page, a web service, etc.) on the web → URI Persistence — non-normative spec
- URI Reuse
- Regardless of how a resource is created, it is suggested that the server SHOULD NOT reuse a URI
- There are specific cases where a URI can be restored when identifying the same resource, but this only applies when it conforms to URI persistence in web architecture (i.e., when it points to the same resource)
- Disabling URI Reuse
- If a server deletes a resource and intends to no longer use that URI,
- → Returns a **410** status code to the client
- Indicates that the resource has been permanently removed, and is used to prevent URI reuse
- URI Reuse
- → Uniquely = same URI = must always point to the same resource
- URI Ownership
- Does not address the relationship between storage owners and URI ownership
Resources
- 1. Storage Resource
- The server MUST provide one or more storages.
- Each storage is a storage resource (pim:Storage) and serves as the root container of all self-contained resources.
- Mermaid
- graph TD subgraph Storage 3 root1["Root Container 3"] resource1["Resource d"] resource2["Resource "] root1 --> resource1 root1 --> resource2 end subgraph Storage 2 root2["Root Container 2"] resource3["Resource c"] root2 --> resource3 end subgraph Storage 1 root3["Root Container 1"] resource4["Resource a"] resource5["Resource b"] root3 --> resource4 root3 --> resource5 end
- If the server supports multiple storages, the URIs MUST be allocated in non-overlapping spaces.
- The process of finding a resource's storage through client-server communication
- sequenceDiagram participant C participant S **C->>S:** HTTP GET **/some/resource** S->>C: HTTP 200 OK S->>C: Link: <http://www.example.com/**some**>; rel="other" **C->>S:** HTTP GET /**some** S->>C: HTTP 200 OK S->>C: Link: <http://www.example.com**/**>; rel="another" **C->>S:** HTTP GET **/ (Root)** S->>C: HTTP 200 OK S->>C: Link: <http://www.example.com/**storage**>; rel="type" **C->>S:** HTTP GET /**storage** S->>C: HTTP 200 OK S->>C: Content-Type: text/turtle **C->>S: Parsing RDF Response** Note over C, S: Found relation **rel="type"** targeting **<http://www.w3.org/ns/pim/space#storage**>
- (For HTTP GET, HEAD, and OPTIONS requests targeting resources in the storage,) in the response
- Include a Link header with rel="URI of the storage description resource".
- Link header with rel="<http://www.w3.org/ns/solid/terms#**storageDescription**>"
HTTP/1.1 200 OK Link: <http://www.example.com/storageDescription>; rel="<http://www.w3.org/ns/solid/terms#storageDescription>" Link: <http://www.example.com/owner>; rel="<http://www.w3.org/ns/solid/terms#owner>" - (For HTTP HEAD or GET requests targeting the root container,) in the response
- Track one or more owners of the storage
- Include a Link header with rel="URI of the owner"
- Link header with rel="<http://www.w3.org/ns/solid/terms#**owner**>"
HTTP/1.1 200 OK Link: <http://www.example.com/owner>; rel="<http://www.w3.org/ns/solid/terms#owner>"
- The place where data owned by the user is stored and managed
- 2. Resource Containment
- The representation and behavior of containers correspond to LDP Basic Containers and are supported by the server
- A collection of linked resources to help with resource discovery and lifecycle management
- Within the path-name hierarchy
- There is a 1-1 correspondence between container triples and relative references
- /container: the main container
- /container/resource1: the first resource
- /container/resource2: the second resource
- Subject: the URI of the main container (/container)
- Predicate: rdf:type
- Object: the URI of the container type (http://www.w3.org/ns/iana/media-types/{+iana-media-type}#Resource)
- /container/resource1: the first resource inside the /container
- /container/resource2: the second resource inside the /container
- </aside>
- The container triple and relative references that represent this structure can be expressed as follows:
- <aside> ?️ Example structure
- There is a 1-1 correspondence between container triples and relative references
- All resources in the container
- Discoverable (a resource without a source cannot exist)
- (For HEAD and GET requests targeting a container,) in the response
- The server MAY determine the value of the HTTP Last-Modified header field based on changes to the container triangle.
- Contained Resource Metadata
- A method to provide additional information about contained resources to the client as an extension of the container description
- rdf:type: a class of the URI template expansion, where **iana-media-type** corresponds to the value of an IANA media type.
- stat:size: a non-negative integer representing the resource size.
- dcterms:modified: the date and time when the resource was last modified.
- stat:mtime: the Unix time when the resource was last modified.
- HTTP/1.1 200 OK Link: <http://www.example.com/resource1>; rel="containedResourceMetadata" Link: <http://www.example.com/resource2>; rel="containedResourceMetadata" Link: <http://www.example.com/resource3>; rel="containedResourceMetadata" <http://www.example.com/resource1> a <http://www.w3.org/ns/iana/media-types/text/plain#Resource> ; stat:size 1024 ; dcterms:modified "2023-01-15T12:30:00Z" ; stat:mtime 1642259400 . <http://www.example.com/resource2> a <http://www.w3.org/ns/iana/media-types/image/jpeg#Resource> ; stat:size 2048 ; dcterms:modified "2023-01-16T14:45:00Z" ; stat:mtime 1642346700 . <http://www.example.com/resource3> a <http://www.w3.org/ns/iana/media-types/application/json#Resource> ; stat:size 4096 ; dcterms:modified "2023-01-17T10:15:00Z" ; stat:mtime 1642433700 .
- Additional information (resource metadata)
- A method to provide additional information about contained resources to the client as an extension of the container description
- This is to support client navigation and application interaction
- 3. Auxiliary Resources
- Has the URL "https://example.com/resource",
- and there are two auxiliary resources related to this resource.
- Web Access Control( https://example.com/**resource-acl**)
- An auxiliary resource of the Web Access Control type provides an access control description for the subject resource (Web Access Control).
- Description Resource( https://example.com/**resource-description**)
- The server MUST NOT directly link more than one description resource to the subject resource
- Web Access Control( https://example.com/**resource-acl**)
- (These auxiliary resources) are linked to the subject resource using the HTTP Link header → through the Link header, the relationship with Web Access Control and Description Resource is indicated on the subject resource
- GET /resource HTTP/1.1 Host: [example.com](<http://example.com/>) Link: <https://example.com/resource-acl>; rel="acl" Link: <https://example.com/resource-description>; rel="describedby"
- **The Subject Resource** is
