From the last post in this series, I'm continuing to share my learning and till day practice in testing the APIs. In this context, this post will have information on below mentioned.
- HTTP and REST, the difference exist
I wish to keep the below topics in the next post so that it helps in gaining the clarity of RESTful APIs with different protocols.
- The usual in the WEB API testing
- The "not thought about" in testing APIs -- Web and RESTful
HTTP and REST, the difference exist
HTTP is a protocol and one of the way to transfer the files. This will connect the pages in the World Wide Web. While the REST is set of constraints documented for the architectural style for web. This constraints are to ensure the scalability and ease use of the web systems.
The common understanding for an engineer is the web runs on HTTP and so the RESTful API.Yes, the REST API will use and can use HTTP as communicating and transfer protocol. This understanding is common because one might see HTTP being used often and most times with RESTful APIs. But it is not mandate that RESTful API should always use HTTP only. The RESTful API can also be for FTP, SMTP and other protocols to transfer and communicate.
Now let me reiterate this line again from above paragraph,
"While the REST is set of constraints documented for the architectural style for web"The web has many protocols to communicate and transfer; one among them is the HTTP. So now we know the idea that RESTful API can be designed and used for any communicating and transfer protocols other than HTTP.
Then the difference between REST and HTTP to mention here in short is as below:
- HTTP API is the any API which makes use of HTTP as its protocol.
- RESTful API sticks on to all REST constraints which are described in the dissertation of Roy Fielding.
Usually the 'Web API' is referred to HTTP API. However it is good to seek clarity when one hears "it is the Web API". That means, SOAP can also be HTTP API if it uses HTTP. If the SOAP can use HTTP for transfer and communication, then RESTful API are possible for SOAP as well over HTTP, isn't it? This looks to be tricky in understanding but it is not. Spending sometime to ponder and explore on this area, will give the clarity in learning this.