114k views
5 votes
RESTful APIs What HTTP method is used to replace an existing item at the URI? Pick ONE option -) GET -) POST -) PATCH -) PUT

User Hynek
by
6.5k points

1 Answer

2 votes

Final answer:

In RESTful APIs, the HTTP method PUT is used to replace an existing item at the URI, differentiating it from POST for creation and PATCH for partial updates.

Step-by-step explanation:

To replace an existing item at the URI in a RESTful API, the HTTP method used is PUT.

This method is idempotent, meaning that making multiple identical requests will produce the same result as making a single request. In contrast to POST, which is used to create a new resource, and PATCH, which is used for partial updates, PUT is meant to update an existing resource or create it if it does not exist at the specified URI.

User IMathieuB
by
7.3k points