top of page

Introduction To REST Assured

What Is REST Assured ?

REST Assured is an open source JAVA based library which is highly used in REST API test automation or Restful web services and in API response validation including API parameters validations.The library supports all the HTTP methods.

It has a Gherkin type syntax and supports BDD(Behaviour Driven Development) approach.It provides various features for JSON response,DSL like syntax, specification reuse,xpath validation,easy file uploads and can also be used to test XML based web services.

Rest Assured can be integrated with all major automation frameworks like- testNG,JUnit,maven and CI/CD.

To request a command for REST API,HTTP methods are used and they are five in numbers as follows :

 

 

Once the request is sent through these methods,the client receives the numeric codes known as 'Status Codes' or 'Response Codes' that have some meaning.These codes can be interpreted to know the response sent by the server.

It helps to interpret the outcome of HTTP request.

Status codes are classified into five categories as follows :

Status codes 1XX,2XX and 3XX are not considered as errors but are informative messages and will not affect the user experience.

However,status codes 4XX and 5XX are error meassages.

Refer next page Configure Eclipse With REST Assured

Method

  • GET

  • PUT

  • POST

  • DELETE

  • PATCH

Description

  • Retrieves the information at a particular URL.

  • Updates the previous resource if it exists or creates new information at a particular URL.

  • Used to send information to server like uploading data and also to develop a new entity.

  • Deletes all current representations at a specific URL.

  • Used for partial updates of resources.

Status Code

  • 1XX (100-199)

  • 2XX (200-299)

  • 3XX (300-399)

  • 4XX (400-499)

  • 5XX (500-599)

Description

  • The response is informational.

  • Assures successful response.

  • You are required to take further action to fufill the request.

  • There's a bad syntax and the request can't be completed.

  • The server entirely fails to complete the request.

bottom of page