Content
@
https://opensea.io/collection/dev-21
0 reply
0 recast
2 reactions
greg
@gregfromstl
When is it appropriate to create a POST vs a GET? I keep seeing APIs use a POST for seemingly no reason and it drives me crazy
5 replies
2 recasts
12 reactions
Moon
@moon.eth
It is common for some APIs to do everything with a POST because they are doing a simple mapping between library functions and the POST URL. IMPORTANT: a GET call on your system should just return something not make changes. It is permissible to make changes needed for serving the resource, but repeated calls should not re-run that process, just return the same data. (this is called "idempotency") Search engines spider websites using GET, if a GET made changes, it would be disastrous for you and them so don't do that.
0 reply
0 recast
1 reaction