Basic API Testing (Postman)
Basic API Testing (Postman)
TESTING
POSTMAN
Basic - Part 1
By
V.R
What is Client and Server -
Client/Server Architecture -
Examples -
What is an API -
Types of API’s -
Examples -
URL - https://google.com/api/testing
URI - //google.com/api/testing
URN - /api/testing
https://google.com/apis/testing
Payload -
Payload means the body in the HTTP request and response message.
Postman Interface -
Validations -
After sending the request the response will be displayed in response block.
From this response we can validate like:
1. Status Code
2. Body
3. Cookies
4. Headers
5. Test Results
6. Time
7. Size
Status Code -
In Postman, status codes are numeric codes that indicate the response
status of an HTTP request. They provide information about the outcome
of the request and help in understanding whether the request was
successful or encountered an error.
Level 200 -
200 : OK
201 : Created
202 : Accepted
203 : Non - Authoritative info
204 : No Content
Level 200 is Successful level information.
Level 400 -
400 : Bad Request
401 : Unauthorized
403 : Forbidden
404 :Not Found
409 : Conflict
Level 400 is when request is unauthorized or not specified proper
authorization.
Level 500 -
500 : Internal Server
501 : Not Implemented
502 : Bad Gateway
503 : Service Unavailable
504 : Gateway Timeout
599 : Network Timeout
Level 500 is when there is a network issue server down or maintenance.
Time -
Size -
Size refers to the size of the HTTP response received from the server
when making an API request. It indicates the total size of the response
body, including the headers and the response payload.
Response Body -
A Response body is the body of the response, which actually contains the
response content that has been sent from the server. In this section, you
can see the web page code is sent to us as a response.
Headers -
Test Results -
The Test Results refer to the outcome or output of running tests within a
request or collection. When you send a request in Postman, you can
include tests that will be automatically executed after the request is sent.
These tests are written in JavaScript and can be used to verify the
response received from the server.
Cookies -
Cookies are small text files that are created by websites and stored on a
user's device (such as a computer or mobile device) through the user's
web browser. They are used to store information about the user's
browsing activity and preferences.
In Postman, cookies are small pieces of data that are sent by a web server
to a client and are stored on the client-side. Cookies are used to maintain
session information and track user activity across multiple requests and
responses.