rest - What is meant by PUT method idempotent in RESTful web service? -
i trying decide http method should used put or post.
while looking @ posts on stackoverlflow see this post.
one of answers in post says
put idempotent, if put object twice, has no effect. nice property, use put when possible.
can 1 me out here example. lets have scenario trying create student entry passed in student table in rdbms.
so here if try put entry again , again there no effect?
in put, you're setting all values of resource, when put done, know state of resource. if wait week , call put again, still know state of resource.
a post, contrast, not idempotent - post subset of values. if call post today, wait week, , make same post call again, don't know state of resource - might have changed value you're not setting in post.
idempotent means no matter when or how make call, end state of resource same.
delete , idempotent.
Comments
Post a Comment