Lots of websites (e.g. twitter, stackexchange) provide RESTful OPEN APIs based on the HTTP protocol. Can I design a RESTful service based on some other protocol (such as raw TCP)?
REST APIs add no new capability to HTTP APIs. But it is an architectural style that was created in tandem with HTTP and most typically employs HTTP as its application layer protocol. However, REST isn't always linked to HTTP. You can use other transfer protocols, such as FTP, SMTP, etc.
REST is not necessarily tied to HTTP. RESTful web services are just web services that follow a RESTful architecture. HTTP is a contract, a communication protocol and REST is a concept, an architectural style which may use HTTP, FTP or other communication protocols but is widely used with HTTP.
In order for an API to be considered RESTful, it has to conform to these criteria: A client-server architecture made up of clients, servers, and resources, with requests managed through HTTP.
REST is web standards based architecture and uses HTTP Protocol. It revolves around resource where every component is a resource and a resource is accessed by a common interface using HTTP standard methods.
If you look at Roy Fielding's PhD thesis, you'll see that REST is defined in chapter 5, while it's applied to HTTP in chapter 6.
"Representational state transfer" is indeed quite abstract. There's no reason you couldn't apply it to your own adhoc protocol. The aim is to make it stateless, to have safe read methods (that are cacheable), and if possible idempotent write methods.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With