The rest is POST VS GET if the payload is huge

I understand the definition of GET and POST as shown below.

GET: A list of collection members, complete with their URI members for further navigation. For example, list all cars for sale.

POST: create a new entry in the collection where the identifier is automatically assigned by the collection. The generated identifier is usually included as part of the data returned by this operation.

The MY API is looking for some details on a server with a huge request payload with a JSON message in this case. Which verb should I use?

Alternatively, can someone tell me the length of the characters that can be passed in the query string.

+4
source share
5 answers

GET POST , URL-, . , GET URL. 200 , Internet Explorer, -, URL 2 .

, , , GET -, POST .

, GET , .

+8

, , , .

. API- , . , :

1. X-HTTP--:

GET POST/PUT X-HTTP-Method-Override, GET. .

2. :

. POST/PUT , /db / . "Location", "Key/id", .

GET /, POST. , .

+3

API, RESTful POST , URI, .

, , "" .

+2

,

, Id

. 3 4 . angularjs

:

Example : $http.get('/getEmployeeDataById?id=22');

Json

:

Example : var dataObj = 
          {
                name : $scope.name,

                age : $scope.age,

                headoffice : $scope.headoffice

          };    

var res = $http.post('/getEmployeesList', dataObj);

, ,

0

, GET. , POST. . , .

-3

Source: https://habr.com/ru/post/1588929/


All Articles