Skip to main content

REST Request in Katalon Studio

Katalon Studio supports sending RESTful requests with parameters, body data, and authorization details needed. When sending a request, you can receive a response from the API server for examination, and troubleshooting. This section gives you detailed information on how to create, and configure a RESTful request.

Create a RESTful Request

You can create a new RESTful request object in two ways. First, you can add a Web Service request to a New or any Existing test case directly in the object details view by a click on the plus icon.

Add web service request to a test case

Or select File > New > Web Service Request from the main menu.

In the New Web Service Request dialog, specify a name for your request; select RESTful in the Request Type's drop-down list; and set request URLs. Then click OK to create a request.

Create a new web service request

Specify request details

After you have created a request successfully, double-click on the request to open its editor for adding details.

Specify a new web service request

Request Method

The request method indicates the expected action to be executed on the specified resource. For REST services, Katalon Studio supports the following methods: GET, POST, PUT, DELETE, PATCH, HEAD, CONNECT, OPTIONS, and TRACE. You can refer to REST API Tutorial: HTTP Methods for more details, and specifications of each method.

For Katalon Studio Enterprise users, you can use custom methods added in Project > Settings > Test Design > Web Service > Custom Method.

Create a custom method

In Tests Explorer, there is a small icon next to the object that indicates its used method. By default, the GET method is selected for new requests.

a GET object

Request URL

You need to specify a URL indicating the service endpoint of each request. For example, the following URL https://petstore.swagger.io/v2/pet/findByStatus?status=${status} is registered for the RESTful request we've created. In URLs, you can use variables, status=${status}, for instance, to update the Query Parameter dynamically. More details.

Query Parameters

This table displays any 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. To learn more about Query Parameters, see: Parameterize a Web Service Object.

Starting from version 7.0.0, Katalon Studio encodes special characters in query parameters before sending requests.

Request Body

You can add the body information needed to be sent along with a RESTful request object. Katalon Studio supports the following body data types: text, x-www-form-urlencoded, form-data, and file.

  • Text: With this type, the supported formats include Text, JSON, XML, HTML, and Javascript.

    Specify HTTP body

  • Form-data: This data type allows you to send data to APIs as multipart/form-data, and attach files as well. From version 7.5.0+, you can specify the content type in the form-data body.

Request Authentication

This part is used for authenticating, and authorizing the request, which means to verify if the client is permitted to send the request, and to perform the endpoint operation.

For more details on using each type of auth, see:

Request Headers

You can configure the header information needed for sending the RESTful request object. By default, the Content-Type value of Header 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.

Starting from version 7.2.5, Katalon Studio supports disabling specifying the content type of HTTP Header based on HTTP Body automatically. This allows users to configure content types for HTTP Header, and Body separately.



Response

After you send a request, Katalon Studio supports reading its response in a separate Response view. A service response comprises Status, Elapsed time, and Size fields; Body section, Header, and Verification Log.

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



Response Body

Katalon can read a service response in JSON, XML, HTML, and JavaScript. The response body can be displayed in three formats: pretty, raw, and preview.

  • pretty: Response is displayed in a pretty format which is easier to read

  • raw: Response is displayed in the raw text without any format

  • preview: Response is displayed as visualized (e.g., If a Response is from loading a specific webpage, it is displayed as the screenshot below)

Response Header

The response's header is displayed in the Header tab:

Verification Log

This tab displays the verification results after the request is tested and verified.

See also: