Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

HTTP 1.1 200 OK
Content-Type: application/hal+json
Content-Length: ...
    {
       "_embedded" : {
"item" : [
{
"_links" : {
"self" : {
"href" : "/users/GeorgeWashington"
}
},
"UserID" : "GeorgeWashington",
"FirstName" : "George",
"LastName" : "Washington"
},
{
"_links" : {
"self" : {
"href" : "/users/AbrahamLincoln"
}
},
"UserID" : "AbrahamLincoln",
"FirstName" : "Abraham",
"LastName" : "Lincoln"
},
{
"_links" : {
"self" : {
"href" : "/users/TheodoreRoosevelt"
}
},
"UserID" : "TheodoreRoosevelt",
"FirstName" : "Theodore",
"LastName" : "Roosevelt"
}
]
},
"_links" : {
"self" : {
"href" : "/users"
}
}
}


In the above JSON formatted response, each user is listed with its relevant field content (UserID, FirstName, and LastName). Each user also includes a self link, associated to the href field, that informs the client how to retrieve this resource. Thus, RESTful responses include content that is both meaningful to humans and machines. As can be seen, clients do not need to be programmed how to retrieve specific users. This information will always be provided in the API response.

There is no established way to handle HATEOAS (or Hypermedia) designed responses. 

Two of the most notable features of RESTful web APIs are:

...