Confirmed users
920
edits
LesOrchard (talk | contribs) |
LesOrchard (talk | contribs) No edit summary |
||
Line 166: | Line 166: | ||
** Content-Type: [[#Addon Collection]] | ** Content-Type: [[#Addon Collection]] | ||
===== POST - Add an addon to a collection | ===== POST - Add an addon to a collection ===== | ||
* Request | * Request | ||
Line 175: | Line 175: | ||
* Response (on success) | * Response (on success) | ||
** Status: <tt> | ** Status: <tt>201 Created</tt> | ||
** Content-Type: | ** Content-Type: empty document | ||
** Location header points to the URL of the addon resource in the collection. | |||
** Location header points to the URL of | |||
* Response (if addon already added) | |||
** Status: 409 Conflict | |||
** Content-Type: [[#Error Document]] | |||
===== DELETE - Delete a collection ===== | ===== DELETE - Delete a collection ===== | ||
Line 224: | Line 227: | ||
=== Representations === | === Representations === | ||
==== Error Document ==== | |||
Most errors will be indicated by an HTTP Status in the 400s or 500s, and will | |||
be accompanied by further details in an XML document like the following: | |||
<?xml version="1.0" encoding="utf-8" ?> | |||
<error xmlns="http://addons.mozilla.org/" | |||
reason="some_reason_for_error" | |||
details="further details for error" /> | |||
Reason values to expect include: | |||
* <tt>invalid_parameters</tt> | |||
* <tt>collection_unknown</tt> | |||
* <tt>not_collection_owner</tt> | |||
* <tt>unknown_addon_guid</tt> | |||
* <tt>addon_already_in_collection</tt> | |||
* <tt>addon_not_in_collection</tt> | |||
* <tt>{GET,POST,DELETE,PUT}_not_allowed</tt> | |||
* <tt>unauthorized</tt> | |||
==== Service Document ==== | ==== Service Document ==== | ||
Line 262: | Line 286: | ||
==== Addon Collection ==== | ==== Addon Collection ==== | ||
<?xml version="1.0" encoding="utf-8" ?> | <?xml version="1.0" encoding="utf-8" ?> |