Module: requestSupport

requestSupport

Source:

Methods


<static> initialize( [options])

Initializes the "request" defaults. Should be called in a context which
contains the CucumberJS methods (Given, Then, Before, etc.)

Parameters:
Name Type Argument Default Description
options object <optional>
{}

merged with
Merged with standard defaults
to set request defaultOptions

Source:
Returns:

undefined

Example
requestSupport.initialize.call(this, options);

<static> requestGET(routeStr [, options])

requestGET - Description

Parameters:
Name Type Argument Default Description
routeStr string

Description

options object <optional>
{}

Description

Source:
Returns:

Description

Type
type

<static> requestPOST(routeStr, bodyStr [, options])

Executes POST request to given routeStr

bodyStr

  • as a string will be interpreted as JSON and passed to the request.
  • as an object with a raw property it is interpreted as a single tow cucumber table.
    The table contents are merged, interpreted as JSON and passed to the request.
  • as a plainObject it is passsed directly to the request.
  • as a function it is assumed to be a done callback and an empty body is sent to the request
Parameters:
Name Type Argument Default Description
routeStr string
bodyStr string | object | function
options object <optional>
{}

Overides to the request defaults.

Source:
Returns:

Response promise from request or null for callback style calls.

Type
Promise | null