What is API Testing?
API testing utilizes programming to send calls to the API and get the yield. It testing regards the segment under test as a black box. The objective of API testing is to confirm right execution and blunder treatment of the part preceding its coordination into an application.
REST API
REST: Representational State Transfer.
- It’s an arrangement of functions on which the testers performs requests and receive responses. In REST API interactions are made via HTTP protocol.
- REST also permits communication between computers with each other over a network.
- For sending and receiving messages, it involves using HTTP methods, and it does not require a strict message definition, unlike Web services.
- REST messages often accepts the form either in form of XML, or JavaScript Object Notation (JSON).
4 Commonly Used API Methods:-
- GET: – It provides read only access to a resource.
- POST: – It is used to create or update a new resource.
- PUT: – It is used to update or replace an existing resource or create a new resource.
- DELETE: – It is used to remove a resource.
Steps to Test API Manually:-
To use API manually, we can use browser based REST API plugins.
- Install POSTMAN(Chrome) / REST(Firefox) plugin
- Enter the API URL
- Select the REST method
- Select content-Header
- Enter Request JSON (POST)
- Click on send
- It will return output response
Steps to Automate REST API