Http post response after multiple new resource cre

2019-09-01 10:03发布

问题:

I understand that 'a' server response to posting an enclosed entity where a new resource is created could be a 'created' plus a location header and a url. That is my normal modus operandi. However I just wrote some server code that, in addition to accepting a single enclosed thing and creating a new resource, also accepts a batch of stuff as an entity and creates multiple resources from it.

As an example, consider /cars. You might post a single new car to make /cars/toyota-camry, or you might post multiple cars at once to result in /cars/toyota-camry, /cars/chevrolet-corvette, etc.

What is the proper response here, if any?