Which HTTP method is used to retrieve data from a server in REST?

Which HTTP method is used to retrieve data from a server in REST?

A) GET
B) POST
C) PUT
D) DELETE

Answer:

A) GET

Explanation:

The GET method in HTTP is used to retrieve data from a server. It is one of the most commonly used methods in RESTful APIs. A GET request fetches the specified resource or data identified by the URL, without making any changes to the resource on the server. Since GET requests do not alter the server state, they are considered safe and idempotent, meaning that multiple identical requests should have the same effect as a single request.

Reference links:

https://www.javaguides.net/p/rest-api-tutorial.html

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top