0

Why can't we use the Post verb to fetch data from the server instead of the Get verb?

  1. Through Post method we can send the parameters in the body to fetch data
  2. Through Get method we will send the parameters in the url which is limited also

So why use Get to fetch data instead of Post

Charlieface
  • 52,284
  • 6
  • 19
  • 43
subha132
  • 3
  • 1
  • 3
  • This has nothing to do with [tag:c#] [tag:.net] [tag:asp.net-web-api], it is purely a [tag:http] question. Please don't spam tags – Charlieface Dec 07 '21 at 22:14
  • The rule isn't set in stone, there are cases where misusing post is necessary and acceptable. This post should answer your questions. https://stackoverflow.com/questions/19637459/rest-api-using-post-instead-of-get – Failwyn Dec 08 '21 at 18:57

2 Answers2

1

Technically you can use POST to fetch data. Many POST requests do return data although they're usually doing something more than fetching.

One factor to consider is that GET requests can be cached, but POST requests are never cached. Some data doesn't change frequently. Some changes rarely.

Requests can be cached in various ways - by the browser, by the server, and by CDNs. All of these result in faster response times and reduced load on the server

Scott Hannen
  • 27,588
  • 3
  • 45
  • 62
0

You can do lot of stuff which isn't intended. But i think the best reason is that its all about the standard of an restful Service.

i.e: https://restfulapi.net/http-methods/