First API request in Postman
How to create an API request?
There are many ways to create a request.
- Click on the “New” button -> “HTTP Request”
2. Click on File-> New -> HTTP Request
3. By just click on the plus icon
Once you follow any of the above methods you will navigate to the interface as follows.
Before creating a request first we can create a collection. To create a collection we can follow one of the methods.
- New -> Collection
2. Click on the plus icon
Now you will get into the following UI to create a collection.
Here we can give a name for the collection.
Now I have created Collection1. Let’s create a simple GET request. Here I’m going to use the following request URL.
Under the collection we can create the request as follows.
View more -> Add request
Now you will get the following UI.
We can simply give a request name and the request URL in the marked areas.
How to run the request?
Now click on the save button and then click on send button. You will get the response as follows.
How to analyze response?
In response we can use options in formats of Pretty, Raw, Preview, Visualize and in the drop down we can choose JSON, XML, HTML, Text or Auto option.
And also we can see that status code, time and size are also mentioned there. And we can choose body, cookies, headers and test results options. Further, we can use copy response, search and save response options under the response section.
Definitions of REST API methods
GET : Retrieve Resource Data
POST : Create Resource
PUT : Modify Resource
DELETE : Delete Resource
HEAD : Identify Active Resource
PATCH : Modify part of the resource
OPTIONS : Identify Communication Options
TRACE : Debugging Purpose
HTTP status codes