-1

I wonder that for all requests from clients to servers. POST can help us to secure data, more safe than GET... So why GET is still exist ?

2 Answers2

0

These will help you understand why GET still exists:

  1. GET requests can be cached
  2. GET requests can remain in the browser history
  3. GET requests can be bookmarked
  4. GET requests can be distributed and shared
Jamal
  • 763
  • 7
  • 22
  • 32
0

It makes routes more concise, and is a fundimental in create RESTful API's. For example I have routes for blog articles, these routes implement basic CRUD functionality(Create, Read, Update, Delete) with the following routes:

[POST] /api/article | Creates an article [GET] /api/article | Lists articles [GET] /api/article/:id | Gets an article by ID [PUT] /api/article/:id | Updates and article by ID [DELETE] /api/article/:id | Deletes article by ID [DELETE] /api/article | Bulk delete articles

So in this example I only actually have 2 routes "/api/article" and "/api/article/:id". But I use 4 different HTTP methods to access them. If I were to just use POST, then I'd have 6 different routes, and if I wanted to articulate that later on I could end up with a big heaping mess of routes, and other developers would not want to work with me.

In addition to the specifications Mustaq Ahmet provided, I believe this example is more tangible to get a sense why GET might be useful. I quoted the answer from this quora answer