You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/presentation/4.0/index.md
+36-2Lines changed: 36 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2740,22 +2740,56 @@ e.g., painting TextualBody on Canvas
2740
2740
2741
2741
# Protocol
2742
2742
2743
+
This section outlines recommendations and requirements related to URIs, HTTP requests, and authentication for IIIF resources.
2743
2744
2745
+
## URI Recommendations
2746
+
2747
+
While any HTTP(S) URI is technically acceptable for any of the resources in the API, there are several best practices for designing the URIs for the resources.
2748
+
2749
+
* The URI _SHOULD_ use the HTTPS scheme, not HTTP.
2750
+
* The URI _SHOULD NOT_ include query parameters or fragments.
2751
+
* Once published, they _SHOULD_ be as persistent and unchanging as possible.
2752
+
* Special characters _MUST_ be encoded.
2744
2753
2745
2754
## HTTP Requests and Responses
2746
2755
2747
-
### URI Recommendations
2756
+
This section describes the _RECOMMENDED_ request and response interactions for the API. The REST and simple HATEOAS approach is followed where an interaction will retrieve a description of the resource, and additional calls may be made by following links obtained from within the description. All of the requests use the HTTP GET method; creation and update of resources is not covered by this specification. It is _RECOMMENDED_ that implementations also support HTTP HEAD requests.
2748
2757
2749
2758
### Requests
2750
2759
2760
+
Clients are only expected to follow links to Presentation API resources. Unlike [IIIF Image API][image-api] requests, or other parameterized services, the URIs for Presentation API resources cannot be assumed to follow any particular pattern.
2761
+
2751
2762
### Responses
2752
2763
2753
-
### Authentication
2764
+
The format for all responses is JSON, as described above. It is good practice for all resources with an HTTP(S) URI to provide their description when the URI is dereferenced. If a resource is [referenced][prezi30-terminology] within a response, rather than being [embedded][prezi30-terminology], then it _MUST_ be able to be dereferenced.
2765
+
2766
+
If the server receives a request with an `Accept` header, it _SHOULD_ respond following the rules of [content negotiation][org-rfc-7231-conneg]. Note that content types provided in the `Accept` header of the request _MAY_ include parameters, for example `profile` or `charset`.
2767
+
2768
+
If the request does not include an `Accept` header, the HTTP `Content-Type` header of the response _SHOULD_ have the value `application/ld+json` (JSON-LD) with the `profile` parameter given as the context document: `http://iiif.io/api/presentation/4/context.json`.
If the `Content-Type` header `application/ld+json` cannot be generated due to server configuration details, then the `Content-Type` header _SHOULD_ instead be `application/json` (regular JSON), without a `profile` parameter.
2777
+
2778
+
{% include api/code_header.html %}
2779
+
```
2780
+
Content-Type: application/json
2781
+
```
2782
+
{: .urltemplate}
2754
2783
2784
+
The HTTP server _MUST_ follow the [CORS requirements][org-w3c-cors] to enable browser-based clients to retrieve the descriptions. If the server receives a request with one of the content types above in the Accept header, it _SHOULD_ respond with that content type following the rules of [content negotiation][org-rfc-7231-conneg]. Recipes for enabling CORS and conditional Content-Type headers are provided in the [Apache HTTP Server Implementation Notes][notes-apache].
2755
2785
2786
+
Responses _SHOULD_ be compressed by the server as there are significant performance gains to be made for very repetitive data structures.
2756
2787
2788
+
## Authentication
2757
2789
2790
+
It may be necessary to restrict access to the descriptions made available via the Presentation API. As the primary means of interaction with the descriptions is by web browsers using XmlHttpRequests across domains, there are some considerations regarding the most appropriate methods for authenticating users and authorizing their access. The approach taken is described in the [Authentication][iiif-auth] specification, and requires requesting a token to add to the requests to identify the user. This token might also be used for other requests defined by other APIs.
2758
2791
2792
+
It is possible to include Image API service descriptions within the Manifest, and within those it is also possible to include links to the Authentication API's services that are needed to interact with the image content. The first time an Authentication API service is included within a Manifest, it _MUST_ be the complete description. Subsequent references _SHOULD_ be just the URI of the service, and clients are expected to look up the details from the full description by matching the URI. Clients _MUST_ anticipate situations where the Authentication service description in the Manifest is out of date: the source of truth is the Image Information document, or other system that references the Authentication API services.
0 commit comments