1.0.1 • Published 7 years ago
codeceptjs-axios v1.0.1
codeceptjs-axios
codeceptjs-http is CodeceptJS helper which wraps axios library to perform requests. It's alternative helper that provides more flexible request management.
Configuration
This helper should be configured in codecept.json/codecept.conf.js
baseURL: base HTTP url.
Example:
{
"helpers": {
"AXIOS" : {
"require": "codeceptjs-axios",
"baseURL": "http://localhost:8080"
}
}
}sendGetRequest
Send HTTP request, response will be availible as return value.
I.sendGetRequest('/api/users.json');Parameters
url- endpoint path. Can be relative or absoluteheaders- (optional) to include token in the headers for example
sendPostRequest
Send HTTP request, response will be availible as return value.
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
sendPatchRequest
Send HTTP request, response will be availible as return value.
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
sendPutRequest
Send HTTP request, response will be availible as return value.
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
sendDeleteRequest
Send HTTP request, response will be availible as return value.
I.sendDeleteRequest('/api/users/1');Parameters
url- endpoint path. Can be relative or absoluteheaders- (optional) to include token in the headers for example