<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=http://222.178.203.72:19005/whst/63/=oZbjZfdognahZzbnl//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)
- [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/axios@1.1.2/dist/axios.min.js"></script>
```
Using unpkg CDN:
```html
<script src="https://unpkg.com/axios@1.1.2/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: 'Flintstone'
})
.then(function (response
没有合适的资源?快使用搜索试试~ 我知道了~
Mac下Stable Diffusion一键安装好用
共440个文件
js:211个
pak:58个
md:33个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 33 浏览量
2024-02-05
10:53:01
上传
评论
收藏 90.29MB ZIP 举报
温馨提示
Stable Diffusion 一键安装,国内镜像,无需魔法,Apple Silicon (M1/M2)使用MPS支持GPU,可以根据任何领域的文本输入生成高质量、高分辨率且逼真的图像。 默认选项MAC M1 10秒出图
资源推荐
资源详情
资源评论
收起资源包目录
Mac下Stable Diffusion一键安装好用
(440个子文件)
Applications 13B
aria2c 4MB
README.md.bak 12KB
update.bat 288B
v8_context_snapshot.x86_64.bin 574KB
range.bnf 619B
range.bnf 619B
chrome_crashpad_handler 1.01MB
axios.cjs 112KB
axios.cjs 81KB
aria2.conf 6KB
index.css 166B
index.d.cts 17KB
Current 1B
Current 1B
Current 1B
Current 1B
icudtl.dat 10.06MB
.DS_Store 15KB
libGLESv2.dylib 7.05MB
libvk_swiftshader.dylib 4.31MB
libffmpeg.dylib 2.45MB
libEGL.dylib 200KB
Electron Framework 145.14MB
Electron Framework 35B
.eslintrc 743B
.eslintrc 180B
.eslintrc 35B
aria2c.exe 4.82MB
.gitignore 1KB
Helpers 24B
index.html 257B
.VolumeIcon.icns 1.12MB
electron.icns 266KB
axios.js 94KB
axios.js 82KB
semver.js 38KB
axios.min.js 31KB
adm-zip.js 30KB
axios.min.js 28KB
http.js 21KB
index.js 19KB
test.js 17KB
utils.js 17KB
range.js 14KB
form_data.js 13KB
zipFile.js 13KB
zipEntry.js 12KB
entryHeader.js 11KB
StableDiffusion.js 11KB
lamaCleaner copy.js 9KB
semver.js 8KB
yallist.js 8KB
xhr.js 8KB
index.js 8KB
utils.js 8KB
subset.js 7KB
re.js 7KB
AxiosHeaders.js 7KB
CondaBase.js 6KB
constants.js 6KB
aria2c.js 6KB
toFormData.js 6KB
node.js 6KB
conda.js 6KB
Axios.js 5KB
zipcrypto.js 5KB
AxiosTransformStream.js 5KB
is.js 5KB
semver.js 5KB
browser.js 5KB
combined_stream.js 5KB
index.js 4KB
mainHeader.js 4KB
debug.js 4KB
lamaCleaner.js 4KB
index.js 4KB
comparator.js 3KB
updater.js 3KB
index.js 3KB
mergeConfig.js 3KB
index.js 3KB
streamify.js 3KB
download.js 3KB
formDataToStream.js 3KB
assertions.js 3KB
index.js 3KB
service.js 3KB
index.js 3KB
index.js 3KB
validator.js 2KB
AxiosError.js 2KB
CancelToken.js 2KB
axios.js 2KB
preload.js 2KB
delayed_stream.js 2KB
isURLSameOrigin.js 2KB
outside.js 2KB
dispatchRequest.js 2KB
formDataToJSON.js 2KB
共 440 条
- 1
- 2
- 3
- 4
- 5
资源评论
小风飞子
- 粉丝: 378
- 资源: 1959
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 信捷PLC 7轴伺服插补联动 XD5-48T6-E PLC 做的7轴联动设备,具备牵引示教功能 用PLC做配方,喷涂机程序 包括PLC和触摸屏程序,中文详细注释
- Unity雨下到玻璃上的效果shader
- 设计电路1-模电Multisim仿真实验
- 基于双向长短期记忆网络(BILSTM)的数据分类预测 matlab代码,要求2019版本及以上
- 数据分析-77-CDNow网站用户消费行为分析(包含代码和数据)
- 开关电源,高频变压器磁芯参数对照表
- Halcon 多区域绘制与掩膜
- 台达eh3与台达变频器modbus rtu通讯程序 程序有注释 实现正反转,写入频率,读取频率,读取电压的功能 plc为台达eh3,触摸屏为dop-107bv,变频器为台达VFD-M
- flyway支持达梦数据库版本jar包
- 基于ssm的酒店预定管理系统的设计与实现【附源码】
- 最近电平接近 NLM 模块化多电平变器matlab simulink仿真模型
- MATLAB仿真MIMO通信系统V-BALST结构ZF检测算 法与MMSE检测算法 形式:程序 1、仿真V-BALST结构ZF检测算法性能,调制方式为QPSK 2、仿真V-BALST结构MMSE检测算
- WPF LiveCharts动态曲线(折线图)
- 微信小程序开发基础与实践指南
- 任务驱动型作文提分训练.doc
- 人版五年级(下册)语文课后习题答案.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功