I had a big doubt about whether it is a good practice to insert a batch of elements in a single request in RESTful, or iterate them and insert an element per request , I have that doubt since in my frontend application, the user accumulates objects and once finished I would insert them as follows:
POST /objects
[
{
"name": "objeto1"
},
{
"name": "objeto2"
}
]
What is not clear to me yet is that I should process them in a single request or iterate them and send them one by one if you could guide me Thank you
As for whether to send everything in the same request, yes, there would be no problem. It depends on what you want to achieve, for performance or transactionality, or how the client-server is implemented, you could do it one way or another.
To send-receive them, simply work with one
List<TuDTO>
(assuming Java, applicable to the language you use).