Skip to content

Commit

Permalink
Merge pull request #293 from RideReport/versions
Browse files Browse the repository at this point in the history
Add versions endpoint.
  • Loading branch information
hunterowens authored Apr 29, 2019
2 parents a2ac43d + 56f5fa1 commit b51aa4f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions provider/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,22 @@ Content-Type: application/vnd.mds.provider+json;version=0.3
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.

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:

```http
OPTIONS /trips/ HTTP/1.1
Host: provider.example.com
Accept: application/vnd.mds.provider+json;version=0.2,application/vnd.mds.provider+json;version=0.3;q=0.9
```

The response will include the most preferred supported version in the `Content-Type` header. For example, if only `0.3` is supported:

```http
Content-Type: application/vnd.mds.provider+json;version=0.3
```

The client can use the returned value verbatim as a version request in the `Accept` header.

### Response Format

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.
Expand Down

0 comments on commit b51aa4f

Please sign in to comment.