Suppose I write a REST service whose intent is to add a new data item to a system.
I plan to POST to
http://myhost/serviceX/someResources
Suppose that works, what response code should I use? And what content might I return.
I'm looking at the definitions of HTTP response codes and see these possibilities:
200: Return an entity describing or containing the result of the action;
201: which means CREATED. Meaning *The request has been fulfilled and resulted in a new resource being created. The newly created resource can be referenced by the URI(s) returned in the entity of the response, with the most specific URI for the resource given by a Location header field. The response SHOULD include an entity containing a list of resource characteristics and location(s) from which the user or user agent can choose the one most appropriate. The entity format is specified by the media type given in the Content-Type header field. *
The latter sounds more in line with the Http spec, but I'm not at all clear what
The response SHOULD include an entity containing a list of resource characteristics and location(s)
means.
Recommendations? Interpretations?