Link Search Menu Expand Document


Using Cookies

Since Cookie is an HTTP request header, it can be represented like in the following contract:

Scenario: Perform an arithmetic operation
  When POST /operate
  And request-header Cookie (string)
  And request-body {"val1": "(number)", "val2": "(number)", "operation": "(string)"}
  Then status 200
  And response-body (number)

A stub that includes the cookie then looks like this:

    "http-request": {
        "method": "POST",
        "path": "/operate",
        "headers": {
            "Cookie": "(string)"
        "body": {
           "val1": 7,
           "val2": 5,
           "operation": "+"
    "http-response": {
        "status": 200,
        "body": 12