Not great at giving definition, but we wan't to design a protocol that our frontend knows how to get data and update data from the backend. We will use built in javascript tools to issue the http requests. The body of the requests will sometimes contain json, a way of formatting javascript objects. Our REST api will also return these json objects (we'll use a java library called jackson with immutables to take care of this for us -- it's less complicated than it sounds).
Getting Started
Follow this if you like videos and this if you don't.
Example
GET /books returns:
[
{
"id": 1,
"title": "The Goldfinch",
"author", "Donna Tart",
"yearPublished": "2014",
"properties": {}
},
{
"id": 2,
"title": "Harry Potter and the Sorcerer's Stone",
"author", "J.K. Rolling",
"yearPublished": "1997",
"properties": {}
}
]
You would get this data by running curl http://our.site.hostname/books
What's a REST api?
Not great at giving definition, but we wan't to design a protocol that our frontend knows how to get data and update data from the backend. We will use built in javascript tools to issue the http requests. The body of the requests will sometimes contain json, a way of formatting javascript objects. Our REST api will also return these json objects (we'll use a java library called jackson with immutables to take care of this for us -- it's less complicated than it sounds).
Getting Started
Follow this if you like videos and this if you don't.
Example
GET /books
returns:You would get this data by running
curl http://our.site.hostname/books