REST

REST helper allows to send additional requests to the REST API during acceptance tests. Unirest library is used to perform requests.

Configuration

Parameters

_executeRequest

Executes unirest request

Parameters

haveRequestHeaders

Set headers for the request

I.haveRequestHeaders({
   'Accept': 'application/json',
   'User-Agent': 'Unirest Node.js'
});

Parameters

sendDeleteRequest

Sends DELETE request to API.

I.sendDeleteRequest('/api/users/1');

Parameters

sendGetRequest

Send GET request to REST API

I.sendGetRequest('/api/users.json');

Parameters

sendPatchRequest

Sends PATCH request to API.

I.sendPatchRequest('/api/users.json', { "email": "user@user.com" });

Parameters

sendPostRequest

Sends POST request to API.

I.sendPostRequest('/api/users.json', { "email": "user@user.com" });

Parameters

sendPutRequest

Sends PUT request to API.

I.sendPutRequest('/api/users.json', { "email": "user@user.com" });

Parameters