I'm creating a restful api for the first time. Let's start with an example: I have a product, that can be linked to multiple categories.
On the client side I want just one form where I can fill in the product details, and I have a multiple selector where I can select my categories.
What's the best practice to handle such a thing. Do I post/put my data to one api call /api/product and handle there the categories. Or do I split the category-selection and product-details in the client and do I create 2 api-calls (one for the product details, one for the category-selection).
I'm looking for the best option here. Both are possible. And just one api call would be the easiest. But I strictly restful, I need 2 &pi-calls...
thanks for your answers!