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

What is the best practice when using HTTP methods which include (GET, POST, PUT, PATCH, DELETE) regarding how to pass parameters/data to the server?

$
0
0

From my experience, this is what I understand at the moment.

  1. Get, delete: we should use query string(filter, sorting...), target-uri-identifier(api/users/1) to pass the data to server, avoid to pass the data in the body of request
  2. Post, put, patch: we should send data in the body of the request oruse target-uri-identifier for put, patch, and avoid using query string in these three methods

Please correct me if I am wrong.Thank you


Viewing all articles
Browse latest Browse all 3655

Trending Articles



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