axios
/
2.0.0
axios 2.0.0
Install from the command line:
Learn more about npm packages
$ npm install @nextcloud/axios@2.0.0
Install via package.json:
"@nextcloud/axios": "2.0.0"
About this version
Simple, typed wrapper of an Axios instance for Nextcloud that automatically sends authentication headers. Cancellation is supported as well.
npm install @nextcloud/axios --save
yarn add @nextcloud/axios
import axios from '@nextcloud/axios'
axios.get('nextcloud.com')
See https://github.com/axios/axios for details.
You are able to define baseURL
to simplify the usage of axios across your app.
import axios from '@nextcloud/axios'
import { generateUrl } from '@nextcloud/router'
const baseURL = generateUrl('/apps/your_app_id/api')
axios.defaults.baseURL = baseURL
References