0

What is the side effect of using get method in java rest web service instead of post or put or delete? I know I have to use get for retrieving data and post for saving. But, what if I used get instead?

  • 1
    Well, GET doesn't allow to send a request body (to submit values). That would be quite a problem. But even if you passed them in the query string, any proxy or browser would be free to send the request multiple times on your behalf, because it expects a GET to be idempotent. A POST is not idempotent. – JB Nizet Sep 04 '17 at 16:38

1 Answers1

0

You can but you will probably going against the design. There are many good discussion here and below are few references,

  1. HTTP GET with request body
  2. REST API using POST instead of GET
  3. REST: Can I use POST request to read data?
Mad-D
  • 4,479
  • 18
  • 52
  • 93