Skip to content

Latest commit

 

History

History
81 lines (47 loc) · 3.21 KB

README.md

File metadata and controls

81 lines (47 loc) · 3.21 KB

What is API ?

An application programming interface is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software.

What is REST API ?

Representational State Transfer (REST) is an architectural style that defines a set of constraints to be used for creating web services. REST API is a way of accessing web services in a simple and flexible way without having any processing.

REST technology is generally preferred to the more robust Simple Object Access Protocol (SOAP) technology because REST uses less bandwidth, simple and flexible making it more suitable for internet usage. It’s used to fetch or give some information from a web service. All communication done via REST API uses only HTTP request.

Working:

A request is sent from client to server in the form of a web URL as HTTP GET or POST or PUT or DELETE request. After that, a response comes back from the server in the form of a resource which can be anything like HTML, XML, Image, or JSON. But now JSON is the most popular format being used in Web Services.

Methods :

In HTTP there are five methods that are commonly used in a REST-based Architecture i.e., POST, GET, PUT, PATCH, and DELETE. These correspond to create, read, update, and delete (or CRUD) operations respectively. There are other methods which are less frequently used like OPTIONS and HEAD.

GET:

The HTTP GET method is used to read (or retrieve) a representation of a resource.

POST:

The POST verb is most often utilized to create new resources.

PUT:

It is used for updating the capabilities.

PATCH:

It is used to modify capabilities

DELETE:

It is used to delete a resource identified by a URI.

Why Choose REST ?

Scalability.

This protocol stands out due to its scalability. Thanks to the separation between client and server, a product may be scaled by a development team without much difficulty.

Flexibility and portability.

With the indispensable requirement for data from one of the requests to be properly sent, it is possible to perform a migration from one server to another or carry out changes on the database at any time. Front and back can therefore be hosted on different servers, which is a significant management advantage.

Independence.

With the separation between client and server, the protocol makes it easy for developments across a project to take place independently. In addition, the REST API adapts at all times to the working syntax and platform. This offers the opportunity to use multiple environments while developing.

Practice Project [ REST Based API Automation Framework ]

This is a API Automation Framework. All Scripts are Written in Java Programming Language. REST- Assured java based library used in this Framework.

Language Used :-

  1. Java Programming Language

Framework :-

  1. TestNg
  2. Junit

Libraries

1)Rest-Assured 2)Jackson

Reporting :-

  1. Allure Reports
  2. TestNG Reports

Tools :-

  1. Maven
  2. IntelliJ IDEA

Tests Performed On a Web Application

https://www.reqres.in