User:Kuno/MBS-211: Difference between revisions
From MusicBrainz Wiki
Jump to navigationJump to search
(New page: Initial request to http://localhost:3000/ws/2/label/b4edce40-090f-4956-b82a-5d9d285da40b <pre> { "country": "GB", "sort_name": "Planet Mu", "name": "Planet Mu", "lifesp...) |
Ianmcorvidae (talk | contribs) m (Ianmcorvidae moved page User:Kuno/mbs-211 to User:Kuno/MBS-211) |
||
(One intermediate revision by one other user not shown) | |||
Line 37: | Line 37: | ||
}, |
}, |
||
"id": "b4edce40-090f-4956-b82a-5d9d285da40b" |
"id": "b4edce40-090f-4956-b82a-5d9d285da40b" |
||
} |
|||
</pre> |
|||
Submit that as a PUT request, something like this: |
|||
curl --digest --user kuno:byld --data-binary document.json --header 'Content-Type: application/json' --header 'Accept: application/json' --request PUT 'http://localhost:3000/ws/2/label/b4edce40-090f-4956-b82a-5d9d285da40b' |
|||
The response would be: |
|||
<pre> |
|||
HTTP/1.0 400 Bad Request |
|||
Content-Type: application/json; charset=utf-8 |
|||
Status: 400 |
|||
{ |
|||
"lifespan": { |
|||
"begin": { |
|||
"errors": [ |
|||
"Not a valid date" |
|||
] |
|||
}, |
|||
"end": { |
|||
"year": { |
|||
"errors": [ |
|||
"Not an integer" |
|||
] |
|||
} |
|||
} |
|||
} |
|||
} |
} |
||
</pre> |
</pre> |
Latest revision as of 23:43, 8 September 2012
Initial request to http://localhost:3000/ws/2/label/b4edce40-090f-4956-b82a-5d9d285da40b
{ "country": "GB", "sort_name": "Planet Mu", "name": "Planet Mu", "lifespan": { "begin": { "year": "2011", "day": null, "month": null } }, "id": "b4edce40-090f-4956-b82a-5d9d285da40b" }
Change some stuff:
{ "country": "GB", "sort_name": "Planet Mu", "name": "Planet Mu", "lifespan": { "begin": { "year": "1995", "month": "02", "day": "30" }, "end": { "year": "19xx", "month": null, "day": null } }, "id": "b4edce40-090f-4956-b82a-5d9d285da40b" }
Submit that as a PUT request, something like this:
curl --digest --user kuno:byld --data-binary document.json --header 'Content-Type: application/json' --header 'Accept: application/json' --request PUT 'http://localhost:3000/ws/2/label/b4edce40-090f-4956-b82a-5d9d285da40b'
The response would be:
HTTP/1.0 400 Bad Request Content-Type: application/json; charset=utf-8 Status: 400 { "lifespan": { "begin": { "errors": [ "Not a valid date" ] }, "end": { "year": { "errors": [ "Not an integer" ] } } } }