Skip to content

Commit b51aa4f

Browse files
authored
Merge pull request #293 from RideReport/versions
Add versions endpoint.
2 parents a2ac43d + 56f5fa1 commit b51aa4f

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

provider/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,22 @@ Content-Type: application/vnd.mds.provider+json;version=0.3
4141
4242
If an unsupported or invalid version is requested, the API must respond with a status of `406 Not Acceptable`. In which case, the response should include a body specifying a list of supported versions.
4343

44+
A client can explicitly negotiate headers using the `OPTIONS` method to an MDS endpoint. For example, to check if `trips` supports either version `0.2` or `0.3` with a preference for `0.2`, the client would issue the following request:
45+
46+
```http
47+
OPTIONS /trips/ HTTP/1.1
48+
Host: provider.example.com
49+
Accept: application/vnd.mds.provider+json;version=0.2,application/vnd.mds.provider+json;version=0.3;q=0.9
50+
```
51+
52+
The response will include the most preferred supported version in the `Content-Type` header. For example, if only `0.3` is supported:
53+
54+
```http
55+
Content-Type: application/vnd.mds.provider+json;version=0.3
56+
```
57+
58+
The client can use the returned value verbatim as a version request in the `Accept` header.
59+
4460
### Response Format
4561

4662
The response to a client request must include a valid HTTP status code defined in the [IANA HTTP Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml). It also must set the `Content-Type` header, as specified in the [Versioning](#Versioning) section.

0 commit comments

Comments
 (0)