Skip to content

Instantly share code, notes, and snippets.

@bohde
Created November 20, 2011 18:43
Show Gist options
  • Select an option

  • Save bohde/1380679 to your computer and use it in GitHub Desktop.

Select an option

Save bohde/1380679 to your computer and use it in GitHub Desktop.
joshbohde@mu:~ $ echo '{"name":"foo"}' | branch: (master)
curl -H 'Content-Type: application/json' -X PUT --data @- "http://localhost:8000/api/v1/artists/1/"
joshbohde@mu:~ $ echo '{"album": {"id": "1", "title": "Physical Graffiti", "artist":"/api/v1/artists/1/"}, "id": "1", "resource_uri": "/playlist/api/v1/tracks/1/", "title": "Custard Pie", "track_number": 1}' |
curl -H 'Content-Type: application/json' -X PUT --data @- "http://localhost:8000/api/v1/tracks/1/"
joshbohde@mu:~ $ curl -H 'Accept: application/json' "http://localhost:8000/api/v1/albums/1/" branch: (master)
{"artist": "/api/v1/artists/1/", "id": "1", "resource_uri": "/api/v1/albums/1/", "title": "Physical Graffiti"}
joshbohde@mu:~ $ echo '{"album": {"id": "1", "title": "OMG Changed Name", "artist":"/api/v1/artists/1/"}, "id": "1", "resource_uri": "/playlist/api/v1/tracks/1/", "title": "Custard Pie", "track_number": 1}' | branch: (master)
curl -H 'Content-Type: application/json' -X PUT --data @- "http://localhost:8000/api/v1/tracks/1/"
joshbohde@mu:~ $ curl -H 'Accept: application/json' "http://localhost:8000/api/v1/albums/1/" branch: (master)
{"artist": "/api/v1/artists/1/", "id": "1", "resource_uri": "/api/v1/albums/1/", "title": "OMG Changed Name"}
joshbohde@mu:~ $ echo '{"name":"foo"}' | branch: (master)
curl -H 'Content-Type: application/json' -X PUT --data @- "http://localhost:8000/api/v1/artists/1/"
joshbohde@mu:~ $ echo '{"album": {"id": "1", "title": "Physical Graffiti", "artist":"/api/v1/artists/1/"}, "id": "1", "resource_uri": "/playlist/api/v1/tracks/1/", "title": "Custard Pie", "track_number": 1}' |
curl -H 'Content-Type: application/json' -X PUT --data @- "http://localhost:8000/api/v1/tracks/1/"
joshbohde@mu:~ $ curl -H 'Accept: application/json' "http://localhost:8000/api/v1/albums/1/" branch: (master)
{"artist": "/api/v1/artists/1/", "id": "1", "resource_uri": "/api/v1/albums/1/", "title": "Physical Graffiti"}
joshbohde@mu:~ $ echo '{"album": {"id": "1", "title": "OMG Changed Name", "artist":"/api/v1/artists/1/"}, "id": "1", "resource_uri": "/playlist/api/v1/tracks/1/", "title": "Custard Pie", "track_number": 1}' | branch: (master)
curl -H 'Content-Type: application/json' -X PUT --data @- "http://localhost:8000/api/v1/tracks/1/"
joshbohde@mu:~ $ curl -H 'Accept: application/json' "http://localhost:8000/api/v1/albums/1/" branch: (master)
{"artist": "/api/v1/artists/1/", "id": "1", "resource_uri": "/api/v1/albums/1/", "title": "OMG Changed Name"}
joshbohde@mu:~ $ echo '{"album": {"id": "1", "title": "Fuzz bizz", "artist":"/api/v1/artists/1/", "resource_uri":"/api/v1/albums/1/"}, "id": "1", "resource_uri": "/playlist/api/v1/tracks/1/", "title": "Custard Pie", "track_number": 1}' |
curl -H 'Content-Type: application/json' -X PUT --data @- "http://localhost:8000/api/v1/tracks/1/"
joshbohde@mu:~ $ curl -H 'Accept: application/json' "http://localhost:8000/api/v1/albums/1/" branch: (master)
{"artist": "/api/v1/artists/1/", "id": "1", "resource_uri": "/api/v1/albums/1/", "title": "Fuzz bizz"}%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment