Star

Created With

linkRequest Cookies

Optionally specify a list of cookies to be sent with the request. These will be sent as distinct Cookie headers (as per the HTTP spec).

linkBasic Example

1linkconfiguration:

2link host: api.mycompany.com

3link scheme: https

4link base_path: /api

5linkspecs:

6link - request:

7link method: get

8link path: /account

9link headers:

10link - name: Accept

11link value: application/json

12link cookies:

13link - name: XSRF-Token

14link value: 399do284kds32odh28

15link response:

16link status_code: 200

See also: Example: Suite Using Cookies



linkDynamically Set Cookies

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

1linkconfiguration:

2link scheme: http

3link host: 127.0.0.1

4link port: 3027

5linkspecs:

6link - before_test:

7link run_type: inline

8link inline:

9link function: !!js/function >

10link function() {

11link this.test.cookies = {cookie1: 'cookie1-value'}

12link }

13link request:

14link path: /echoCookies

15link method: get

16link response:

17link status_code: 200

18link json_data:

19link - path: $.cookie1

20link value: cookie1-value

See also: Example: Suite Using Cookies



Request CookiesBasic ExampleDynamically Set Cookies

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