Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should calculation requests be a GET or POST?

I'm building some services with ASP.NET Web API to perform calculations. Should the requests be GETs or POSTs?

The calculations will have 0..n parameters, but most likely 3-6. I plan to put the parameters in the body as json. This leads me to think I should be using POSTs.

Thoughts? Thanks!

like image 705
DenaliHardtail Avatar asked Nov 22 '25 01:11

DenaliHardtail


1 Answers

Given that the calculations are idempotent, you should use GET. Browsers may cache these requests by default (which I assume for your application is a good thing). Also, there will be no annoying "postback data to server" or whatever popups.

like image 83
Brad M Avatar answered Nov 24 '25 22:11

Brad M



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!