This file contains 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
{ | |
"1":{ | |
"key":{ | |
"gray":"No service on Saturday" | |
}, | |
"out":{ | |
"stops":[ | |
"Liberation Station", | |
"La Mare Slip", | |
"Le Bourg", |
This file contains 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
<resource href="documents/123/versions" xmlns="http://hal.schema.huddle.net/2011/02/"> | |
<link rel="parent" href="documents/123" /> | |
<resource rel="documentVersion" title="a new title" href="documents/123/versions#543"> | |
<link rel="content" href="..." /> | |
<link rel="thumb" href="..." /> | |
<resource title="Barry Potter" rel="updated-by actor" href="..."> | |
<link rel="avatar" href="..." type="image/jpg" /> | |
<link rel="alternate" href="..." type="text/html" /> |
This file contains 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
public class MvcApplication : System.Web.HttpApplication | |
{ | |
public static void RegisterRoutes(RouteCollection routes) | |
{ | |
routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); | |
routes.MapRoute( | |
"Default", // Route name | |
"{controller}/{action}/{id}", // URL with parameters |
This file contains 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": { | |
// single | |
"example": { "_href": "/foo" }, | |
// multiple (array) | |
"task": [ | |
{ "_href": "/task1" }, | |
{ "_href": "/task2" } | |
], | |
// multiple (hash) |
This file contains 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
<resource href="/"> | |
<motd>Welcome. Today's special offer: by 600 flat whites and get an extra free.</motd> | |
<link rel="rb:orderList" href="/order-list" /> | |
</resource> |
This file contains 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": "http://example.com/" } } } |
This file contains 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": "/orders" }, | |
"next": { "href": "/orders?page=2" }, | |
"search": { "href": "/orders?id={order_id}" } | |
}, | |
"_embedded": { | |
"order": [ | |
{ | |
"_links": { |
This file contains 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
<resource href="http://example.com/" /> |
This file contains 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
(defresource "example" | |
(GET (lambda (req) | |
'(200 | |
(:content-type "text/plain") | |
("This is the example resource")))) | |
(POST (lambda (req) | |
'(200 | |
(:content-type "text/plain") | |
("Thanks for posting something"))))) |
This file contains 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
I've added a control element with these properties/attributes: | |
method ; method to use for generated request e.g. POST/PUT/DELETE | |
content-type ; (optional) content-type of the request body generated by the template (defaults to application/hal+xml) | |
schema ; contains schema for data submitted to template | |
template ; (optional) A string or object representing the template or form for the request. | |
template-href ; (optional) Contains a URI which links to a resource where the template or form can be fetched. | |
template-type ; (optional) URI used to identify the template format in use (defaults to mustache). |