Representational State Transfer (REST) defines a set of architectural principles by which you can design Web services that focus on systems’ resources and how these resource states are addressed and transferred over HTTP by client applications written in different languages. REST requires that a client make a request to the server to retrieve or modify data on the server. A request generally consists of:

  • an HTTP verb, which defines what kind of operation to perform

  • a header, which allows the client to pass along information about the request

  • a path to a resource

  • an optional message body containing data

The basic HTTP verbs to interact with resources in a REST system are:

  • GET — retrieve a specific resource (by id) or a collection of resources

  • POST — create a new resource

  • PUT/PATCH — update a specific resource (by id)

  • DELETE — remove a specific resource by id

Operation HTTP

REST

SQL Equivalent

Create a resource on the server

POST

INSERT

Retrieve a resource

GET

SELECT

Update or change a resource state

PUT/PATCH

UPDATE

Remove or delete a resource

DELETE

DELETE


  • No labels