Posts

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:  ...

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 acce...

Understanding of parseInt() funtion in JavaScript

Image
parseInt() function in javascript is used to parse a string element and returns as an integer.  Syntax: It takes two parameters: String : The string to be converted to an integer. Radix (optional) : An integer between 2 and 36 that represents the base of the numeral system used in the string. This is an optional parameter, and if not specified, JavaScript assumes the following: If the string begins with "0x" or "0X", it is parsed as a hexadecimal number. (Example is given at last). It is always better to specify by the programmers for clarity and understanding.                                             Syntax: parseInt(String,radix) or parseInt(String)   Otherwise, it is parsed as a decimal number.                                     ...

How to Install Jenkins

Image
Jenkins is an open-source Java application server for Continuous Integration and Continuous Delivery (CI/CD). This will run in servlet containers such as Apache Tomcat. It helps the developers to build, test, and deploy the software by automating using CI/CD pipelines. It detects bugs and notifies the developers in an early stage. How to Download and Install: Step 1: Go to https://www.jenkins.io/ . Click Download Step 2: Download Jenkins ‘Generic Java package’. I prefer to download the LTS package (It is a stable one). Step 3: Select your desired path after downloading and save the Jenkins.war file in your local system. Step 4: Go to command prompt (Windows) | Terminal (IOS)                Go to the folder where the war file is saved. Then, type the command java -jar Jenkins.war and run it. It will take a while to run the command. It gives an admin password. Note it down to use Jenkins the first time. The ...

Variety of Keys...

 The power of keys in the real world makes its own purpose. There are different types of keys to operate a lock. Why do we have different types of keys? Because it serves to open a lock made for a specific reason. The most commonly used locks are deadlocks for residential doors and external security, knob locks for internal doors in residences, padlocks for lockers, gates, and sheds, keycard systems for hotels and offices, smart/digital door locks for modern homes and offices, tubular locks for vending machines and ATMs, time locks for bank vaults and safety. When we come into the application, APIs provide connectivity between applications to exchange data and services. To make it secure, we use authentication and authorization.  Authentication allows the user to access the application. Authorization 's main focus is to have the right people to have the right access to the right resources.  We have various authentication types to secure accessing the API in the software ...