CodeceptJS helper for REST request wraps axios
npm install codeceptjs-axioscodeceptjs-http is CodeceptJS helper which wraps axios library to
perform requests. It's alternative helper that provides more flexible request management.
This helper should be configured in codecept.json/codecept.conf.js
- baseURL: base HTTP url.
Example:
``json`
{
"helpers": {
"AXIOS" : {
"require": "codeceptjs-axios",
"baseURL": "http://localhost:8080"
}
}
}
Send HTTP request, response will be availible as return value.
`js`
I.sendGetRequest('/api/users.json');
Parameters
- url - endpoint path. Can be relative or absoluteheaders
- - (optional) to include token in the headers for example
Send HTTP request, response will be availible as return value.
`js`
I.sendPostRequest('/api/users.json', { "email": "user@user.com" });
Parameters
- url - endpoint path. Can be relative or absolutepayload
- - the request body to sendheaders
- - (optional) to include token in the headers for example
Send HTTP request, response will be availible as return value.
`js`
I.sendPatchRequest('/api/users.json', { "email": "user@user.com" });
Parameters
- url - endpoint path. Can be relative or absolutepayload
- - the request body to sendheaders
- - (optional) to include token in the headers for example
Send HTTP request, response will be availible as return value.
`js`
I.sendPutRequest('/api/users.json', { "email": "user@user.com" });
Parameters
- url - endpoint path. Can be relative or absolutepayload
- - the request body to sendheaders
- - (optional) to include token in the headers for example
Send HTTP request, response will be availible as return value.
`js`
I.sendDeleteRequest('/api/users/1');
Parameters
- url - endpoint path. Can be relative or absoluteheaders` - (optional) to include token in the headers for example
-