Slide 36
Slide 36 text
REST APIs Example Scenario Pitfalls of REST Design More Leveraging HTTP REST Examples
Returns a Collection of Flights
HTTP/1.1 200 OK
Content-type: application/vnd.mycompany.myapp-v1.0+json
{ "flights": [
{ "flightno": "NZ1234", "time": "4:20",
"links": [
{ "href": "/flight/15263", "method": "GET",
"rel": "details", "type": "application/vnd.mycompany.myapp+json" },
{ "href": "/booking", "method": "POST",
"rel": "confirm", "type": "application/vnd.mycompany.myapp+json" },
]
},
{ "flightno": "EH123", "time": "3:55",
"links": [
{ "href": "/flight/523525, "method": "GET",
"rel": "details", "type": "application/vnd.mycompany.myapp+json" },
{ "href": "/booking", "method": "POST",
"rel": "confirm", "type": "application/vnd.mycompany.myapp+json" },
]
}
]
}
Service-Oriented Architecture | Representational State Transfer (REST) and HATEOAS 36/84