I have a cars entity and a people entity, and have REST endpoints that pretty much match:
curl -i -X POST -H "Content-Type:application/json" http://localhost:8888
/cars/ -d '{"name":"Fuson","color":"red","foo":"bar"}'
curl -i -X POST -H "Content-Type:application/json" http://localhost:8888
/people/ -d '{"name":"John","age":"27","foo":"bar"}'
I also have a many-to-many people_have_cars entity.
To add a record, what should the REST endpoint look like? For instance, the person and car be in the URL or in the body? If in the URL, any particular order? Should it be POST, PUT, or PATCH? What should it return?
What about same questions for deleting the many-to-many record?