REST API
Starting the application
$ mvn clean install
$ cd rest-api
$ mvn tomcat7:run
It will start to listen on http://localhost:8080/pa165/rest
.
Please note, that the resource id’s are autogenerated and the links in this documentation containing them will probably not work.
Teams
Listing
GET /teams
For example curl -s -v http://localhost:8080/pa165/rest/teams
{
"teams": [
{
"id": "189a62f3-4529-484c-96b1-8986adbfc784",
"name": "Praha FK"
},
{
"id": "39619a0f-bdcb-472b-8693-43589045eb2d",
"name": "Opava FC"
},
{
"id": "52dec92d-49a0-4d77-bd8a-5e92150ee81e",
"name": "Ostrava FC"
}
]
}
Get one team
GET /teams/{teamId}
For example curl -s -v http://localhost:8080/pa165/rest/teams/52dec92d-49a0-4d77-bd8a-5e92150ee81e
{
"team" : {
"id" : "bca40447-210e-4f79-83ed-4ba2b82f8fd5",
"name" : "Opava FC"
}
}