Skip to content

Instantly share code, notes, and snippets.

View mikekelly's full-sized avatar

Mike Kelly mikekelly

View GitHub Profile
@mikekelly
mikekelly / min_hal.xml
Created June 14, 2011 21:25
minimum valid hal representation
<resource href="http://example.com/" />
@mikekelly
mikekelly / hal_example.json
Created June 15, 2011 13:47
Example use of HAL's JSON variant
{
"_links": {
"self": { "href": "/orders" },
"next": { "href": "/orders?page=2" },
"search": { "href": "/orders?id={order_id}" }
},
"_embedded": {
"order": [
{
"_links": {
@mikekelly
mikekelly / min_hal.json
Created June 15, 2011 16:41
minimum valid hal representation
{ "_links": { "self": { "href": "http://example.com/" } } }
<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>
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
<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" />
{
"1":{
"key":{
"gray":"No service on Saturday"
},
"out":{
"stops":[
"Liberation Station",
"La Mare Slip",
"Le Bourg",
@mikekelly
mikekelly / jsybus_geo_data
Created October 11, 2011 08:40
Bus Stop Geo Location Data
[
"AA BOX,
49.19379,
-2.03498,
2323,
3,
1",
"AALSMEER,
49.22448,
-2.06781,
{
"_links": {
"self": { "href": "/todo-list" },
"search": { "href": "/todo-list/search;{searchterm}" },
"description": { "href": "/todo-list/description" }
},
"_embedded": {
"item": [
{
"_links": {