Sobes.tech
Middle

What is REST API and which HTTP methods are most commonly used?

sobes.tech AI

Answer from AI

REST API (Representational State Transfer) is an architectural style for creating web services that uses standard HTTP methods to interact with resources.

Main characteristics of REST API:

  • Use of URLs to identify resources.
  • HTTP status codes to convey the result of an operation.
  • No state on the server between requests (stateless).

The most commonly used HTTP methods are:

  • GET — retrieve data from the server.
  • POST — create a new resource.
  • PUT — completely update an existing resource.
  • PATCH — partially update a resource.
  • DELETE — delete a resource.

For example, for working with users:

  • GET /users — get a list of users
  • POST /users — create a new user
  • PUT /users/123 — update the user with ID 123
  • DELETE /users/123 — delete the user with ID 123
What is REST API and which HTTP methods are most… - sobes.tech