Star

Created With

linkRequest Query Parameters

Update (or override) request query params.

linkBasic Example

1linkconfiguration:

2link host: api.mycompany.com

3link scheme: https

4link base_path: /api

5linkspecs:

6link - request:

7link path: /users

8link method: get

9link query_params:

10link - name: firstName

11link value: Matthew

12link response:

13link status_code: 200

14link# GET https://api.mycompany.com/users?firstName=Matthew

See also: Example: Suite Using Query Params



linkDynamically Set Query Parameters

Dynamic query params can be added by setting query_params as an object to the this.test context:

1linkconfiguration:

2link host: api.mycompany.com

3link scheme: https

4link base_path: /api

5linkspecs:

6link - before_test:

7link run_type: inline

8link inline:

9link function: !!js/function >

10link function () {

11link this.test.query_params = {

12link firstName: 'Matthew',

13link };

14link }

15link request:

16link path: /users

17link method: get

18link response:

19link status_code: 200

20link# GET https://api.mycompany.com/users?firstName=Matthew

See also: Overview of Hooks



Request Query ParametersBasic ExampleDynamically Set Query Parameters

Home

Getting Startedchevron_right
Basicschevron_right
Requestchevron_right

Request Basics Headers Cookies Query Parameters Path Parameters

Payload Bodychevron_right

File Uploads Auto-Retry Additional Options

Response Validationchevron_right

Overview

Assertionschevron_right

Status Code Headers & Cookies

Bodychevron_right
Hooks & JSchevron_right

Overview

Function Typeschevron_right
Suite-Level Hookschevron_right
Spec-Level Hookschevron_right
Contextchevron_right
DRY & Reusing Specschevron_right
Command Line Interface (CLI)chevron_right