Reputation: 71
Is it possible to design this way. Can put method retrieve the data?
Upvotes: 1
Views: 1122
Reputation: 671
To answer your question. Yes you can.
Any of of GET,POST,PUT,DELETE methods can return a Representation (Response Object) No framework will stop you (Most).
Should I do that?
Well, These HTTP verbs are there for a reason. In other words, they describe what they do.
In case of PUT:
Client sends Representation to update existing one. Server returns either 200 with empty body / 200 with newly updated representation
Just to add, If you don't want GET
to do what you trying to do, Use POST
with some sensible URL
Upvotes: 2