Application and API usage

loicdescotte edited this page Mar 5, 2011 · 9 revisions
Clone this wiki locally

Application and API usage

API usage

Get albums

Use the following URL patterns :

  • GET /api/albums.{format}
  • GET /api/albums/{genre}.{format}
  • GET /api/albums/{genre}/{year}.{format}

Your can replace {format} by xml or json

Get artists list

  • GET /api/artists.{format}

Post albums to server

Using cURL or Firefox Poster, send data to /api/album URL with POST

Example :

{ "name":"Death Magnetic", "artist":{ "name":"Metallica" }, "releaseDate":"12 sept. 2010 00:00:00", "genre":"METAL" }

Admin login

Go to admin/login with your browser to log in as admin in the webapp

Run tests

Run "play test" in your terminal and go to http://localhost:9000/@tests with your browser