Can I use POST or PUT rest endpoints to create or update list of items? or These should be always deal with single resource object?
URL: POST/cars
request body:
{
[ {id:car1}, {id:car2}, {id:car3} ]
}
If I pass list of resources to these endpoints, how I can deal with exception scenarios on creating or updating specific a particular item in the resource list?
It is ok to send list of items (rather than single item) to update to PUT endpoint?
It's not recommended to use POST or PUT to create a list of resources. Even if you want to update/create a list then you can pass the resource which represents a list.
like the below with a URL like
URL: POST/dogsto update a specific item you could use PATCH and also PUT is to update the entire resource.