JSON resourceful API endpoint for the HTML5 class. There is one resource: a sighting.
GET /sightings.json
for a JSON array of all sightings.POST /sightings.json
withContent-Type: application/json
to create a sighting:
{
"sighting": {
"kind": "Unicorn",
"date": "2013-02-20",
"location": "Candy Mountain",
"witnesses": 2,
"name": "Charlie"
}
}
GET /sightings/:id.json
to get a JSON representation of the sighting with:id
.PUT /sightings/:id.json
to update an existing sighting of:id
(same content type and data asPOST
).DELETE /sightings/:id.json
to destroy sighting with:id
.