Last active
August 29, 2015 14:19
-
-
Save smellymonk/a339872ad7c4422cad63 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_links": { | |
"self": { "href": "/customers/1234" }, | |
"collection": { "href": "/customers" } | |
}, | |
"name": "Bob Jones", | |
"street": "123 California Ave", | |
"city": "Sacramento", | |
"state": "CA", | |
"zip": "12345", | |
"phone": "+1 (123) 456 7890", | |
"active": true, | |
"credit_limit": "48" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_links": { | |
"self": { "href": "/customers" }, | |
"item": [{ | |
"href": "/customers/1", | |
"title": "Sally" | |
}, { | |
"href": "/customers/2", | |
"title": "Sue" | |
}, { | |
"href": "/customers/3", | |
"title": "Joe Biden" | |
}, { | |
"href": "/customers/1234", | |
"title": "Bob Jones" | |
}] | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_links": { | |
"self": { "href": "/customers" } | |
}, | |
"_embedded": { | |
"item": [{ | |
"_links": { | |
"self": { "href": "/customers/1" } | |
}, | |
"name": "Sally", | |
"street": "123 California Ave", | |
"city": "Sacramento", | |
"state": "CA", | |
"zip": "12345", | |
"phone": "+1 (123) 456 7890", | |
"active": true, | |
"credit_limit": "10" | |
}, | |
{ | |
"_links": { | |
"self": { "href": "/customers/2" } | |
}, | |
"name": "Sue", | |
"street": "123 California Ave", | |
"city": "Sacramento", | |
"state": "CA", | |
"zip": "12345", | |
"phone": "+1 (123) 456 7890", | |
"active": true, | |
"credit_limit": "20" | |
}, | |
{ | |
"_links": { | |
"self": { "href": "/customers/3" } | |
}, | |
"name": "Joe Biden", | |
"street": "123 California Ave", | |
"city": "Sacramento", | |
"state": "CA", | |
"zip": "12345", | |
"phone": "+1 (123) 456 7890", | |
"active": true, | |
"credit_limit": "30" | |
}, | |
{ | |
"_links": { | |
"self": { "href": "/customers/1234" } | |
}, | |
"name": "Bob Jones", | |
"street": "123 California Ave", | |
"city": "Sacramento", | |
"state": "CA", | |
"zip": "12345", | |
"phone": "+1 (123) 456 7890", | |
"active": true, | |
"credit_limit": "48" | |
}] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note that for the embedded resources case, you could have pagination. See http://phlyrestfully.readthedocs.org/en/latest/halprimer.html#collections
...and notice the "self", "prev", "next", "first", and "last" link relations which are all standard IANA link relations for pagination.