REST


Stands for “Representational State Transfer.”

REST is an outlined set of requirements for transferring assets over the net. The REST methodology is often utilized to APIs (“REST APIs”), which permit builders to entry knowledge from distant programs over the Internet.

REST defines six architectural constraints:

  1. Client-server mannequin – a server processes shopper requests, and shoppers can solely entry required knowledge from the server
  2. Stateless – requests are transient and no shopper knowledge is saved on the server
  3. Cachable – requests will be cached to enhance efficiency
  4. Uniform interface – entry to knowledge should be constant for all customers and programs
  5. Layered system assist – requests will be processed hierarchically and routed throughout a number of programs
  6. Code on demand (non-compulsory) – servers can ship executable code to shopper programs

REST vs. SOAP

REST is usually contrasted with SOAP, one other set of requirements for transferring knowledge over the Internet. However, REST is solely a design fashion, whereas SOAP is an precise protocol with particular guidelines and instructions. Both REST and SOAP APIs transmit knowledge over HTTP, however SOAP is restricted to XML knowledge, whereas REST is more versatile.

Because SOAP is an official protocol, all messages despatched through SOAP should use the identical “envelope” format, with a header and physique. REST, which got here after SOAP, has fewer constraints and is usually thought-about a light-weight various to SOAP.

NOTE: APIs that conform to REST tips are technically known as “RESTful APIs,” however many builders consult with them as “REST APIs” as a substitute.

Looking to know more Internet Terms