The HTTP/1.1 standard states that if a POST
operation results in the creation of a resource, then the response should include a Location
header with the address of the new resource.
If a resource has been created on the origin server, the response SHOULD be 201 (Created) and contain an entity which describes the status of the request and refers to the new resource, and a Location header (see section 14.30).
and in section 14.30,
For 201 (Created) responses, the Location is that of the new resource which was created by the request.
Now suppose that my API allows batch creation of resources by POST
ing an array to the collection resource URL. For example:
POST /books
[
{
"name": "The Colour of Magic",
"published": "1983"
},
{
"name": "The Light Fantastic",
"published": "1986"
}
]
Since two \book\{bookId}
resources have been created, what should be the value of the Location
header in this case?
The question Http post response after multiple new resource creation? is similar, but it asks about the response entity, not the headers (and is unanswered).