200-301 · Question #1234
Which two HTTP methods are suitable for actions performed by REST-based APIs? (Choose two.)
The correct answer is C. POST D. GET. The following HTTP methods are commonly used in REST-based APIs: GET: Used to retrieve data or resources from the server. The GET method is safe and idempotent, meaning it should not modify the server state and can be repeated without causing any side effects. POST: Used to submi
Question
Which two HTTP methods are suitable for actions performed by REST-based APIs? (Choose two.)
Options
- AREMOVE
- BREDIRECT
- CPOST
- DGET
- EPOP
How the community answered
(44 responses)- A2% (1)
- B2% (1)
- C89% (39)
- E7% (3)
Explanation
The following HTTP methods are commonly used in REST-based APIs: GET: Used to retrieve data or resources from the server. The GET method is safe and idempotent, meaning it should not modify the server state and can be repeated without causing any side effects. POST: Used to submit data to the server for processing or to create new resources. The POST method is non-idempotent, as subsequent requests with the same data may result in multiple resource creations. PUT: Used to update or replace an existing resource on the server. The PUT method requires the client to send the complete representation of the resource, effectively replacing the previous DELETE: Used to remove a resource from the server. PATCH: Used to partially update a resource. Unlike PUT, the PATCH method only sends the changes to be applied to the resource rather than replacing the entire representation.
Topics
Community Discussion
No community discussion yet for this question.