<h1 align="center">
<b>
<a href="https://axios-http.com"><img src="https://axios-http.com/assets/logo.svg" /></a><br>
</b>
</h1>
<p align="center">Promise based HTTP client for the browser and node.js</p>
<p align="center">
<a href="https://axios-http.com/"><b>Website</b></a> â¢
<a href="https://axios-http.com/docs/intro"><b>Documentation</b></a>
</p>
<div align="center">
[![npm version](https://img.shields.io/npm/v/axios.svg?style=flat-square)](https://www.npmjs.org/package/axios)
[![CDNJS](https://img.shields.io/cdnjs/v/axios.svg?style=flat-square)](https://cdnjs.com/libraries/axios)
[![Build status](https://img.shields.io/github/actions/workflow/status/axios/axios/ci.yml?branch=v1.x&label=CI&logo=github&style=flat-square)](https://github.com/axios/axios/actions/workflows/ci.yml)
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod&style=flat-square)](https://gitpod.io/#https://github.com/axios/axios)
[![code coverage](https://img.shields.io/coveralls/mzabriskie/axios.svg?style=flat-square)](https://coveralls.io/r/mzabriskie/axios)
[![install size](https://img.shields.io/badge/dynamic/json?url=https://packagephobia.com/v2/api.json?p=axios&query=$.install.pretty&label=install%20size&style=flat-square)](https://packagephobia.now.sh/result?p=axios)
[![npm bundle size](https://img.shields.io/bundlephobia/minzip/axios?style=flat-square)](https://bundlephobia.com/package/axios@latest)
[![npm downloads](https://img.shields.io/npm/dm/axios.svg?style=flat-square)](https://npm-stat.com/charts.html?package=axios)
[![gitter chat](https://img.shields.io/gitter/room/mzabriskie/axios.svg?style=flat-square)](https://gitter.im/mzabriskie/axios)
[![code helpers](https://www.codetriage.com/axios/axios/badges/users.svg)](https://www.codetriage.com/axios/axios)
[![Known Vulnerabilities](https://snyk.io/test/npm/axios/badge.svg)](https://snyk.io/test/npm/axios)
</div>
## Table of Contents
- [Features](#features)
- [Browser Support](#browser-support)
- [Installing](#installing)
- [Package manager](#package-manager)
- [CDN](#cdn)
- [Example](#example)
- [Axios API](#axios-api)
- [Request method aliases](#request-method-aliases)
- [Concurrency ð](#concurrency-deprecated)
- [Creating an instance](#creating-an-instance)
- [Instance methods](#instance-methods)
- [Request Config](#request-config)
- [Response Schema](#response-schema)
- [Config Defaults](#config-defaults)
- [Global axios defaults](#global-axios-defaults)
- [Custom instance defaults](#custom-instance-defaults)
- [Config order of precedence](#config-order-of-precedence)
- [Interceptors](#interceptors)
- [Multiple Interceptors](#multiple-interceptors)
- [Handling Errors](#handling-errors)
- [Cancellation](#cancellation)
- [AbortController](#abortcontroller)
- [CancelToken ð](#canceltoken-deprecated)
- [Using application/x-www-form-urlencoded format](#using-applicationx-www-form-urlencoded-format)
- [URLSearchParams](#urlsearchparams)
- [Query string](#query-string-older-browsers)
- [ð Automatic serialization](#-automatic-serialization-to-urlsearchparams)
- [Using multipart/form-data format](#using-multipartform-data-format)
- [FormData](#formdata)
- [ð Automatic serialization](#-automatic-serialization-to-formdata)
- [Files Posting](#files-posting)
- [HTML Form Posting](#-html-form-posting-browser)
- [ð Progress capturing](#-progress-capturing)
- [ð Rate limiting](#-progress-capturing)
- [ð AxiosHeaders](#-axiosheaders)
- [Semver](#semver)
- [Promises](#promises)
- [TypeScript](#typescript)
- [Resources](#resources)
- [Credits](#credits)
- [License](#license)
## Features
- Make [XMLHttpRequests](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) from the browser
- Make [http](https://nodejs.org/api/http.html) requests from node.js
- Supports the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) API
- Intercept request and response
- Transform request and response data
- Cancel requests
- Automatic transforms for [JSON](https://www.json.org/json-en.html) data
- ð Automatic data object serialization to `multipart/form-data` and `x-www-form-urlencoded` body encodings
- Client side support for protecting against [XSRF](https://en.wikipedia.org/wiki/Cross-site_request_forgery)
## Browser Support
![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox_48x48.png) | ![Safari](https://raw.githubusercontent.com/alrra/browser-logos/main/src/safari/safari_48x48.png) | ![Opera](https://raw.githubusercontent.com/alrra/browser-logos/main/src/opera/opera_48x48.png) | ![Edge](https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge_48x48.png) | ![IE](https://raw.githubusercontent.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png) |
--- | --- | --- | --- | --- | --- |
Latest â | Latest â | Latest â | Latest â | Latest â | 11 â |
[![Browser Matrix](https://saucelabs.com/open_sauce/build_matrix/axios.svg)](https://saucelabs.com/u/axios)
## Installing
### Package manager
Using npm:
```bash
$ npm install axios
```
Using bower:
```bash
$ bower install axios
```
Using yarn:
```bash
$ yarn add axios
```
Using pnpm:
```bash
$ pnpm add axios
```
Once the package is installed, you can import the library using `import` or `require` approach:
```js
import axios, {isCancel, AxiosError} from 'axios';
```
You can also use the default export, since the named export is just a re-export from the Axios factory:
```js
import axios from 'axios';
console.log(axios.isCancel('something'));
````
If you use `require` for importing, **only default export is available**:
```js
const axios = require('axios');
console.log(axios.isCancel('something'));
```
For cases where something went wrong when trying to import a module into a custom or legacy environment,
you can try importing the module package directly:
```js
const axios = require('axios/dist/browser/axios.cjs'); // browser commonJS bundle (ES2017)
// const axios = require('axios/dist/node/axios.cjs'); // node commonJS bundle (ES2017)
```
### CDN
Using jsDelivr CDN (ES5 UMD browser module):
```html
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/axios.min.js"></script>
```
Using unpkg CDN:
```html
<script src="https://unpkg.com/[email protected]/dist/axios.min.js"></script>
```
## Example
> **Note**: CommonJS usage
> In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with `require()`, use the following approach:
```js
import axios from 'axios';
//const axios = require('axios'); // legacy way
// Make a request for a user with a given ID
axios.get('/user?ID=12345')
.then(function (response) {
// handle success
console.log(response);
})
.catch(function (error) {
// handle error
console.log(error);
})
.finally(function () {
// always executed
});
// Optionally the request above could also be done as
axios.get('/user', {
params: {
ID: 12345
}
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
})
.finally(function () {
// always executed
});
// Want to use async/await? Add the `async` keyword to your outer function/method.
async function getUser() {
try {
const response = await axios.get('/user?ID=12345');
console.log(response);
} catch (error) {
console.error(error);
}
}
```
> **Note**: `async/await` is part of ECMAScript 2017 and is not supported in Internet
> Explorer and older browsers, so use with caution.
Performing a `POST` request
```js
axios.post('/user', {
firstName: 'Fred',
lastName:
没有合适的资源?快使用搜索试试~ 我知道了~
基于vue与springboot的sftp远端服务器文件管理系统
共2000个文件
js:1840个
md:102个
json:57个
需积分: 0 4 下载量 117 浏览量
2024-03-05
14:13:43
上传
评论
收藏 30.25MB ZIP 举报
温馨提示
基于vue与springboot的sftp远端服务器文件管理系统
资源推荐
资源详情
资源评论
收起资源包目录
基于vue与springboot的sftp远端服务器文件管理系统 (2000个子文件)
dep-YJaePtkC.js 2.15MB
element-plus.js 1.88MB
rollup.js 740KB
node-entry.js 739KB
lodash.js 531KB
vue.global.js 468KB
vue.esm-browser.js 440KB
vue.runtime.global.js 325KB
dep-kjUoH5nk.js 322KB
chunk-SPFAV2OM.js 312KB
vue.runtime.esm-browser.js 302KB
chunk-CASXVYPU.js 259KB
index.iife.js 222KB
dep-Sacttr-6.js 222KB
vue-router.global.js 155KB
vue-router.esm-browser.js 142KB
vue.esm-browser.prod.js 133KB
vue.global.prod.js 130KB
watch.js 128KB
index.js 119KB
core.js 113KB
index.iife.min.js 98KB
axios.js 97KB
vue-router.js 94KB
parseAst.js 87KB
main.js 86KB
vue.runtime.esm-browser.prod.js 85KB
vue.runtime.global.prod.js 85KB
axios.js 83KB
parseAst.js 80KB
lodash.min.js 71KB
axios.js 66KB
index.iife.js 56KB
floating-ui.core.umd.js 40KB
floating-ui.core.esm.js 34KB
axios.min.js 33KB
axios.min.js 29KB
cli.js 29KB
floating-ui.dom.umd.js 27KB
vue-router.global.prod.js 24KB
index.iife.min.js 24KB
dep-I1uDMLJL.js 24KB
md5.js 23KB
http.js 22KB
loadConfigFile.js 21KB
index.js 20KB
index.iife.js 20KB
floating-ui.dom.esm.js 20KB
js-md5.js 19KB
watch-cli.js 19KB
index.js 18KB
tinycolor.umd.min.js 18KB
index.js 18KB
test.js 17KB
utils.js 17KB
_baseConvert.js 16KB
@element-plus_icons-vue.js 16KB
parser.js 14KB
index.js 13KB
lazy-result.js 13KB
dep-8a-6Quh6.js 13KB
core.min.js 12KB
floating-ui.core.umd.min.js 12KB
install.js 11KB
container.js 10KB
watch.js 10KB
template.js 10KB
template.js 10KB
_mapping.js 10KB
map-generator.js 9KB
floating-ui.dom.umd.min.js 9KB
index.js 9KB
md5.min.js 9KB
xhr.js 9KB
node.js 9KB
stringifier.js 8KB
index.js 8KB
estree-walker.js 8KB
random.js 7KB
conversion.js 7KB
format-input.js 7KB
random.js 7KB
dayjs.min.js 7KB
estree-walker.js 7KB
wrapperLodash.js 7KB
AxiosHeaders.js 7KB
format-input.js 7KB
index.js 6KB
tokenize.js 6KB
sourcemap-codec.umd.js 6KB
conversion.js 6KB
input.js 6KB
floating-ui.utils.dom.umd.js 6KB
debounce.js 6KB
debounce.js 6KB
toFormData.js 6KB
index.js 6KB
_baseClone.js 5KB
Axios.js 5KB
floating-ui.utils.react.umd.js 5KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
wuxinhhh
- 粉丝: 33
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功