REST API Best practices: args in query string vs in request body

A REST API can have arguments in several places:

  1. In the request body – As part of a json body, or other MIME type
  2. In the query string – e.g. /api/resource?p1=v1&p2=v2
  3. As part of the URL-path – e.g. /api/resource/v1/v2

What are the best practices and considerations of choosing between 1 and 2 above?
2 vs 3 is covered here.

4 Answers
4

Leave a Comment