Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 4797

Rest - GET vs POST

$
0
0

I want to design an API call following REST principles.

Let's assume I want to get users info where Users are identified with ids.

With a GET method, the call would look : /users?id=XXXXX, YYYYY, ....

The problem with this is : what happens when the list of users sent is too big ? The URI size limit is reached.

With a POST method, the call would look like : /users

and the request body would look like :

{"users": [XXXXX, YYYYY]}

As far as I know, GET method should only be used to read data, and POST method to create new resources.

How should I design this properly ?


Viewing all articles
Browse latest Browse all 4797

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>