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
Steve
@stevedylandev.eth
From GitHub’s API docs, usually what I lean towards
2 replies
0 recast
3 reactions
Zinger ↑
@zinger
To me a POST is for updating data while a GET is for querying it Exception is GraphQL where a POST is recommended for everything and things are split at the query / mutation level instead
1 reply
0 recast
1 reaction
phil
@phil
Example?
1 reply
0 recast
0 reaction
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
pugson
@pugson
this annoys me as well
0 reply
0 recast
0 reaction