best practice or good convention about RESTFul API.
I have an endpoint for adding a dns record
[POST] /api/v1/dns/records : add single record
[POST] /api/v1/dns/records/bulk : add plural records
Or
[POST] /api/v1/dns/records : by default add plural records.
What is the best uses for an API ? Im just curious, hope all of u can help. Thanks
The second one. Also, always send whatever URL you're expecting to be called by the client. Don't let them construct or hardcode it.
PUT and POST in the collection URL
Обсуждают сегодня