Skip to content

Commit

Permalink
added extension for accepts property on link object
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Levy committed Jul 4, 2015
1 parent 1da67ce commit 9c70e81
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions link-with-accepts.md
@@ -0,0 +1,39 @@
# 'accepts' property for link

Add an optional property, <code>accepts</code>, to the <code>link</code> object whose purpose is to allow the server to indicate the representations available for the indicated resource. If present, the value MUST be a string and SHOULD contain a comma separated list of valid media types.

##example
```json
{
"collection": {
"version":"1.0",
"href":"/members/pending",
"items": {
{
"href":"/members/1",
"data": [
{"prompt":"name", "name":"full-name", "value":"john doe"},
{"prompt":"enrollment date", "name":"enrollment-date", "value":"2015-06-01"},
],
"links" : [
{"href":"/members/1/contract", "rel":"/rels/contract", "prompt":"contract", "name":"contract", "accepts":"application/pdf, text/html"}
]
},
{
"href":"/members/2",
"data": [
{"prompt":"name", "name":"full-name", "value":"homer"},
{"prompt":"enrollment date", "name":"enrollment-date", "value":"2015-05-29"},
],
"links" : [
{"href":"/members/2/contract", "rel":"/rels/contract", "prompt":"contract", "name":"contract", "accepts":"application/pdf, text/html"}
]
}
}
}
}

```

##References
[https://groups.google.com/forum/#!topic/collectionjson/C1GB4UC7_mc](https://groups.google.com/forum/#!topic/collectionjson/C1GB4UC7_mc)

0 comments on commit 9c70e81

Please sign in to comment.