
GET to fetch data.
/api/resourcePOST to create data
/api/resourcePUT to update an entire resource
/api/resource/:idPATCH to partially update a resource
/api/resource/:idDELETE to delete a resource
/api/resource/:idIt is important to maintain backward compatibility when modifying endpoints.
A common practice for REST is to release a new API version.
In the case of GraphQL you can add new fields (like _v2) without removing the old one in the API.
This can protect the API from DDOS attacks, controlling the number of requests a user/ip can make in certain timeframe.
Cross Origin Resource Sharing allows you to control which domains can access your API, preventing cross-site interactions.