Http post response after multiple new resource creation?

*爱你&永不变心* 提交于 2019-12-12 06:06:20

问题


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?

来源:https://stackoverflow.com/questions/28128258/http-post-response-after-multiple-new-resource-creation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!