Toggle menu

axios

This module provides a promise based HTTP client. The library is distributed under the MIT license, for full details and documentation see https://www.npmjs.com/package/axios

Note that axios is only available from version 2.0.4 of the platform's End Point workers. To check the version you have installed, open the API Servers section of the iCM/API Servers management menu:

End Point Worker Version
 

Example

You should always include a timeout when making requests to third parties. The documentation linked to above shows several ways you can do this.

async function(params, credentials) {
    const axios = require("axios");
    let resp = await axios.get("https://jsonplaceholder.typicode.com/todos/1", {
        timeout: 5000
    });
    return resp.data;
}

Last modified on March 18, 2022

Share this page

Facebook icon Twitter icon email icon

Print

print icon