About Question enthuware.jwpv6.2.967 :

Moderator: admin

Post Reply
ETS User

About Question enthuware.jwpv6.2.967 :

Post by ETS User »

The Q 49 of set 5 is as given:
Which of the following HTTP protocol methods is eligible to produce unintended side effects upon multiple identical invocations beyond those caused by a single invocation?
The options givens are:
  • GET
  • POST
  • HEAD
  • PUT
  • OPTIONS
The answer givens is POST. But POST is non-idempotent so we can not use for the given scenario as it can have the side effect. So correct option should be GET.
The explanation given is also contradictory:
The recommended semantics of a GET request are such that if you invoke the same request repeatedly, there should be no extra side effects. For example, a GET request for retrieving an image will not cause any side effect no matter how many times you issue the request.

On the other hand, if you issue a POST request repeatedly, you cannot hold the servlet developer responsible for causing unintended side effects. For example, if you submit a form for making a reply in a forum multiple times, the reply may get posted multiple times.

In practice, many developers do not follow this convention. A simple rule of thumb is that any activity that modifies something (such as a database) should be performed only on a POST request (and not on a GET request).
Please clarify.

Thanks,
Sanjay

admin
Site Admin
Posts: 10384
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.967 :

Post by admin »

Since POST is not idempotent, that is why it is ELIGIBLE to produce a side affect, which is what the question is asking.

HTH,
Paul.

Guest

Re: About Question enthuware.jwpv6.2.967 :

Post by Guest »

Thanks. I got misinterpreted the word
unintended side effects
. Now I am clear on this.

Regards,
Sanjay

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests