Posts

API Testing

Image
In my previous blog, I explained what API is. I will delve deep into the importance of testing the API in this blog. While most testing focuses on the UI, which is crucial, it is equally important to test APIs from the initial stages of the software development. The purpose of API testing is to make sure the interface between two applications is working smoothly without any interruptions. Let me take an example to explain. Seetha tells her mother Latha, that she wants a new pair of shoes for her school. Because it is raining outside and they cannot go shopping directly, Latha decides to buy the shoes online using a mobile application to shop at the “ABC” store. In this example, Latha  is the  client  who sends the request by searching for specific shoe requirements. The  mobile application  is the  API  that gets the request from the client and waits for the response from the server and again it sends back the response to Latha The  “ABC” store  is the  server  that sends the response

A software middleman (API)

Image
We depend on someone/something in every part of our life.  We always need a middleman to solve our purposes. How is the middleman involved in our daily life? We need toothbrushes to clean our teeth. We need a  grocery store to buy groceries. We need utensils/stove to cook our food. We need teeth to chew food. We need mobile phone/communication channels to connect with someone not next to us. We need a  mode of transportation to commute to work/travel. We need a  place to sleep. We need shelter to stay. We need banks for financial transactions. We need hospitals to access healthcare services and many more… In everyone’s life, we need something/someone to complete our needs. Similarly, every system/software requires a middleman to communicate with other systems or software. It generally refers to this software middleman as an Application Programming Interface (API). Do we really correlate our technical knowledge with our everyday life? If the answer is no, then do it from now.

Hypermedia REST API

Image
Hypermedia is nothing but in simple terms it has hyperlinks associated with the API endpoint. It helps the API to link to related resources associated with the endpoint. This reduces the coupling between the server and the client. A hypermedia-driven REST API, often called a HATEOAS (Hypermedia As The Engine of Application State) API, utilizes hypermedia to enable dynamic interactions between clients and servers. In a hypermedia-driven API, clients navigate the API by following hyperlinks embedded within the responses received from the server, rather than relying on predefined URLs or endpoint structures.  Let me take an e-commerce online store as an example to explain more. When I search for a resource namely a product, it associates with its own API endpoint, links to 'Add to Cart', 'Save for Later', 'Buy Now', and 'Similar Products'. These connected links are called  Hypermedia links. I do not need multiple endpoints to refer to other endpoints becaus

Network Protocols

Image
Humans have demonstrated the advantages of using standards and rules in various forms. We follow the food recipe to cook delicious food, follow the ethics governed by the organization in the workplace, follow traffic rules while driving, and many more. Doesn't it apply only to humans? Definitely not! Even computers have certain rules and standards for better performance. There should be a common standard for a system to communicate with other systems because each would have a different operating system, using different programming languages. How should we connect with each other without having any trouble? We call the set of rules and standards "Protocols" for networking. Imagine Network Protocols are like a birthday party invitation. When one computer wants to talk with another, it will send an invitation in a common language they both understand. For example, some computers will speak only Python language and others will speak Java. In this case, for smooth communicatio

HTTP Payloads

Image
 What happens when I send a letter without information to the receiver that I require some details from them? What happens when the receiver writes a response to my letter without having the information I need? This information is similar to the body generally called a payload in HTTP request and response.  Let us see the payload in the HTTP request and HTTP response individually. I have added the below image to explain the HTTP request and response body/payload in JSON. I have used BurpSuite to take this image and Swagger Petstore (petstore.swagger.io) for this example. HTTP Request Payload Generally, the payload is not required for all the requests and responses. GET and HEAD methods usually do not require a body while sending a request to the server. The above example is a POST request to create a resource name 'doggie'. To achieve this, I should send some information about the resource which is called HTTP request payload. Breakdown of request payload: Content-Type:  Specif

Variables in Postman

What is a variable? This is the basic question to learn when you start programming. I am not going to dive deep into the programming concepts. Let me explain the variables used in Postman. What is a Variable in Postman? A data unit, that stores a value and it is dynamic based on the data type we use.  Should be written as Key: Value pair (Example: name= "Test"; num=1;) Provides the facility to access the value without manual effort every time. There are 5 different scopes of variables used in Postman. Global Variables Environment Variables Collection Variables Data Variables Local Variables These variable scopes are specially designed to refer to values in the Postman tool. Global Variable:          When the variable is assigned globally, it has all the privileges of accessing anywhere in the workspace such as the Environment, Collection. Environment Variable:          It is limited within the specific environment where you can access data between collections. Collection Vari