Wednesday, February 19, 2020

POSTMAN Tool to Test API


Download the Postman tool which will help us to test API
API is the link between user input and response from server.
Today API is everything.
Whichever website is rendering data uses API.
In simple terms, API is simple function that may or may not take an input and give the client some result.

Postman help us to validate the API created and test the result.
It check whether the API is working fine.

In POSTMAN, we will come across various URL.

REST API endpoint url+API method + parameter
REST API endpoint URL can be understand as the address or the place where all the function and modular are kept.
API method is the name of function which will return the output which we intend to get.
Parameter is the input that need to be given to the function

Every URL is a HTML response and when we post in on POSTMAN, a HTML response will be returned, note the response in that case is HTML
But if we are using REST API URL, then only two type of response are expected
·      XML
·      JSON

There are four operation that API testing does.
·      GET
·      POST
·      PUT
·      DELETE

A GET request is a protocol that only sends a request with or without parameter and it will return a response.
It will never do any other operation other than to get a output.
There is no updating/deletion/addition operation on server.
i.e. GET has no side-effect on the server, no changes only data.
In GET operation, we never send some sensitive information with the request.
In GET operation, URL words are always visible, so we avoid to keep any sensitive data with the URL.

200 OK is the response status that means whatever was the desired output, we are able to achieve it


COOKIE files are also with response
Cookie is the files that are sent by server when we make a request.
Cookie are the files that are attached with the response. Cookie is downloaded on browser when we visit a URL for the first time. Cookie files help to render the data when we again visit the same website.

POST Request using POSTMAN
In simple terms, POST request is posting something on server.
When se send a POST request, it means we are trying to do some modification on server or web-servers.
Modification can be of any type, like addition, updating, deletion.
Submitting a form is a classic example of POST request as we are trying to send some or the other request to server.
Whenever we send a POST request, it is mandatory that we are sending some or the information.

No comments:

Post a Comment