1

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?

user1992634
  • 764
  • 7
  • 16
  • There is no right or wrong here. Implement what makes most sense for your task. Probably either a list of resources, maybe using json format, or you name the _set_ of resources, so a virtual directory maybe. – arkascha Jan 24 '15 at 17:37
  • That sounds good. I was fearing a "don't do that" response, or a "redesign your whole scheme so a batch of stuff is a single resource" blah blah. – user1992634 Jan 24 '15 at 17:41
  • Some good responses here: [HTTP POST response Location header when creating multiple resources](http://stackoverflow.com/questions/29092787/http-post-response-location-header-when-creating-multiple-resources) – metacubed Feb 03 '17 at 22:23

0 Answers0