How an API request is executed in Postman
Start:
Open Postman and set up for an API request.
Set Up Request:
Enter the API URL.
Select the HTTP method (GET, POST, etc.).
Add headers, query parameters, and the payload/body if required.
Pre-request Script Execution:
Before the request is sent, Postman runs the Pre-request script (if any).
This script can dynamically modify the request by setting variables, generating tokens, or preparing data.
Send API Request:
Postman sends the prepared API request to the server.
Receive Response:
The server processes the request and returns the response, which includes the status code, response body, and response headers.
Tests Script Execution:
Postman then executes the Tests script (if defined).
This script validates the response, checking conditions such as status codes or specific values in the response body.
End:
The request process is complete, and Postman displays the results.
VIDEO
Flow Chart
+---------------------------+
| Start |
+---------------------------+
|
v
+---------------------------+
| Set Up Request |
| - Enter URL |
| - Select Method |
| - Add Headers/Params/Body|
+---------------------------+
|
v
+---------------------------+
| Pre-request Script |
| - Execute Pre-request |
+---------------------------+
|
v
+---------------------------+
| Send API Request |
| - Send Request to Server |
+---------------------------+
|
v
+---------------------------+
| Receive Response |
| - Server Returns Response|
+---------------------------+
|
v
+---------------------------+
| Tests Script Execution |
| - Execute Tests Script |
+---------------------------+
|
v
+---------------------------+
| End |
+---------------------------+