REST Request

Estimated reading time: 2 minutes

  • You can add Web Services request directly from the object details view. Simply click on the plus icon to add to New or any Existing test case.

  1. Select File > New > Web Service Request from the main menu. The New Web Service Request dialog will be displayed where you can input your RESTful URL directly on this dialog.

  2. After you’ve created a request successfully, there will be a small icon next to the object on Tests Explorer to indicate its used method 

  3. In the opened editor of the new service request object, there will be two separate sections for the Request (left pane window) and Response (right pane window)

We will take a look at the Request section using the sample REST URL

https://petstore.swagger.io/v2/pet/findByStatus?status=${status}

FieldDescription
Request method

The request method indicates the expected action to be executed on the specified resource. Katalon Studio supports following methods for REST services: GET, POST, PUT, DELETE, PATCH (Available from version 5.8)

You can refer to more details and specifications of each method here

Request URLThe URL registered for the RESTful web services.
ParametersAny parameter to be passed along with the RESTful request object. These values are generated automatically based on the Request URL or can be manually added.

Authorization

Credentials for HTTP authentication. 

Type: Basic, OAuth 1.0, or No Authorization

    

HTTP Headers

The header information to be included to transmit in the RESTful request object. 'Content-Type' value is generated automatically based on the HTTP Body.

You can also select headers from the list of suggested options (by double-clicking on the Name cell) or enter another header of your interest. Refer to Supported HTTP Headers for more details.

HTTP Body

The body information to be included to transmit in the RESTful request object. Katalon Studio supports the following transmit types:

  • Text
  • x-www-form-urlencoded
  • form-data
  • file

And the following format types:

  • Text
  • JSON
  • XML
  • HTML
  • Javascript

RESTful Response

Since version 5.4, Katalon Studio provides Web Services Response in a separate window pane, which contains more details information of the Request as shown below

Body

There are 3 new information provided in the response’s section:

Field Description
Status The status code of the response
Elapsed The total time that starts from the request is sent until Katalon Studio receives the last byte of the response.
Size Size of the response package

The Response can be displayed in multiple ways

 DescriptionExample
prettyResponse is displayed in a pretty format which is easier to read

rawResponse is displayed in the raw text without any format

preview

Response will be displayed as visualized

(e.g. If a Response is from loading a specific webpage, it will be displayed as the screenshot below)

At the bottom of the Body section, different types of Response format can be selected as desired

  • JSON
  • XML
  • HTML
  • JavaScript

The response’s header information is displayed in the Header tab

See also: