Hypertext Application Language: Difference between revisions

Content deleted Content added
m <pre> for no lang
Format code samples
Tags: nowiki added Visual edit
Line 9:
 
==Example==
General Resource<pre>
{
General Resource { "_links": { "self": { "href": "http://example.com/api/book/hal-cookbook" } }, "id": "hal-cookbook", "name": "HAL Cookbook" }
"_links": {
</pre>
"self": {
 
"href": "http://example.com/api/book/hal-cookbook"
<pre>
}
Embedded resource { "_links": {"self": {"href": "http://example.com/api/book/hal-cookbook"}}, "_embedded": { "author": { "_links": {"self": {"href": "http://author-example.com"}}, "id": "shahadat", "name": "Shahadat Hossain Khan" } } "id": "hal-cookbook", "name": "HAL Cookbook" }
},
</pre>
"id": "hal-cookbook",
 
"name": "HAL Cookbook"
<pre>
}
Collections { "_links": { "self": {"href": "http://example.com/api/book/hal-cookbook"}, "next": {"href": "http://example.com/api/book/hal-case-study"}, "prev": {"href": "http://example.com/api/book/json-and-beyond"}, "first": {"href": "http://example.com/api/book/catalog"}, "last": {"href": "http://example.com/api/book/upcoming-books"} }, "_embedded": { "author": { "_links": {"self": {"href": "http://author-example.com"}}, "id": "shahadat", "name": "Shahadat Hossain Khan" } } "id": "hal-cookbook", "name": "HAL Cookbook" }
</pre>Embedded resource<pre>
{
"_links": {
"self": {
"href": "http://example.com/api/book/hal-cookbook"
}
},
"_embedded": {
"author": {
"_links": {
"self": {
"href": "http://author-example.com"
}
},
"id": "shahadat",
"name": "Shahadat Hossain Khan"
}
},
"id": "hal-cookbook",
"name": "HAL Cookbook"
}
</pre>Collections
{
"_links": {
"self": {
"href": "<nowiki>http://example.com/api/book/hal-cookbook</nowiki>"
},
"next": {
"href": "<nowiki>http://example.com/api/book/hal-case-study</nowiki>"
},
"prev": {
"href": "<nowiki>http://example.com/api/book/json-and-beyond</nowiki>"
},
"first": {
"href": "<nowiki>http://example.com/api/book/catalog</nowiki>"
},
"last": {
"href": "<nowiki>http://example.com/api/book/upcoming-books</nowiki>"
}
},
"_embedded": {
"author": {
"_links": {
"self": {
"href": "<nowiki>http://author-example.com</nowiki>"
}
},
"id": "shahadat",
"name": "Shahadat Hossain Khan"
}
}
"id": "hal-cookbook",
"name": "HAL Cookbook"
}
 
==See also==