Reputation: 1894
I am calling from jQuery $.ajax JsonResult actions from my controller.
I can either use get or post for JsonResult, but are there some good practices regarding this?
I and my colleagues use interchangeably these two, with no logic behind them.
for ActionResult, things is pretty clear: is it a page accessible from the browser? HttpGet. Is it some button on the page? HttpPost.
Upvotes: 0
Views: 109
Reputation: 78
We use the various methods of Http such as
Get To Get the Resource Post To Add the Resource Patch To Modify Resource Delete To Delete Resource
Also if you want to get resource and you are supposed to send the sensitive data then it is always good that you pass that data in body instead of passing as an paramter in URL
Upvotes: 1