@zuplo/cli 6.70.61 → 6.70.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@fastify/reply-from/node_modules/undici/lib/handler/unwrap-handler.js +6 -0
- package/node_modules/@fastify/reply-from/node_modules/undici/package.json +1 -1
- package/node_modules/@fastify/reply-from/node_modules/undici/types/dispatcher.d.ts +2 -0
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-C2TBCXWG.js +26 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-C2TBCXWG.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-GI3LNO4X.js +370 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-GI3LNO4X.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mocks/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/types/index.d.ts +52 -1
- package/node_modules/@zuplo/runtime/out/types/mcp-gateway/index.d.ts +4 -1
- package/node_modules/@zuplo/runtime/out/types/mocks/index.d.ts +4 -1
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/node_modules/axios/CHANGELOG.md +42 -0
- package/node_modules/axios/README.md +237 -237
- package/node_modules/axios/dist/axios.js +113 -21
- package/node_modules/axios/dist/axios.min.js +2 -2
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +121 -15
- package/node_modules/axios/dist/esm/axios.js +121 -15
- package/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +249 -107
- package/node_modules/axios/index.d.cts +8 -3
- package/node_modules/axios/index.d.ts +4 -1
- package/node_modules/axios/lib/adapters/fetch.js +79 -0
- package/node_modules/axios/lib/adapters/http.js +62 -118
- package/node_modules/axios/lib/core/Axios.js +1 -0
- package/node_modules/axios/lib/core/AxiosHeaders.js +2 -2
- package/node_modules/axios/lib/defaults/transitional.js +1 -0
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/Http2Sessions.js +119 -0
- package/node_modules/axios/lib/helpers/buildURL.js +1 -1
- package/node_modules/axios/lib/helpers/formDataToStream.js +2 -2
- package/node_modules/axios/lib/helpers/resolveConfig.js +12 -6
- package/node_modules/axios/lib/helpers/toFormData.js +1 -1
- package/node_modules/axios/lib/utils.js +23 -2
- package/node_modules/axios/package.json +29 -13
- package/node_modules/thread-stream/.claude/settings.local.json +15 -0
- package/node_modules/thread-stream/CLAUDE.md +64 -0
- package/node_modules/thread-stream/README.md +2 -1
- package/node_modules/thread-stream/index.js +41 -13
- package/node_modules/thread-stream/lib/indexes.js +3 -1
- package/node_modules/thread-stream/lib/worker.js +20 -8
- package/node_modules/thread-stream/package.json +1 -1
- package/node_modules/thread-stream/test/base.test.js +61 -88
- package/node_modules/thread-stream/test/message-without-code.js +19 -0
- package/node_modules/thread-stream/test/watch-mode.test.js +28 -0
- package/package.json +6 -6
- package/node_modules/@zuplo/runtime/out/esm/chunk-4SACVMDH.js +0 -26
- package/node_modules/@zuplo/runtime/out/esm/chunk-4SACVMDH.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-6WKYPMAI.js +0 -322
- package/node_modules/@zuplo/runtime/out/esm/chunk-6WKYPMAI.js.map +0 -1
- package/node_modules/axios/dist/axios.js.map +0 -1
- package/node_modules/axios/dist/browser/axios.cjs.map +0 -1
- package/node_modules/axios/dist/esm/axios.js.map +0 -1
- package/node_modules/axios/dist/node/axios.cjs.map +0 -1
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-6WKYPMAI.js.LEGAL.txt → chunk-GI3LNO4X.js.LEGAL.txt} +0 -0
|
@@ -29,27 +29,10 @@
|
|
|
29
29
|
</td>
|
|
30
30
|
<td align="center" width="50%">
|
|
31
31
|
<a
|
|
32
|
-
href="https://
|
|
33
|
-
style="padding: 10px; display: inline-block"
|
|
32
|
+
href="https://opencollective.com/axios/contribute"
|
|
34
33
|
target="_blank"
|
|
34
|
+
>💜 Become a sponsor</a
|
|
35
35
|
>
|
|
36
|
-
<img
|
|
37
|
-
width="90px"
|
|
38
|
-
height="90px"
|
|
39
|
-
src="https://images.opencollective.com/hopper-security/c4f7de2/avatar.png"
|
|
40
|
-
alt="Hopper Security"
|
|
41
|
-
/>
|
|
42
|
-
</a>
|
|
43
|
-
<p align="center">
|
|
44
|
-
Hopper provides a secure, open-source registry where every component is verified against malware and continuously remediated for vulnerabilities across all versions. In simple terms, Hopper removes the need to manage software supply chain risk altogether.
|
|
45
|
-
</p>
|
|
46
|
-
<p align="center">
|
|
47
|
-
<a
|
|
48
|
-
href="https://hopper.security/?utm_source=axios&utm_medium=readme_sponsorlist&utm_campaign=sponsorship"
|
|
49
|
-
target="_blank"
|
|
50
|
-
><b>hopper.security</b></a
|
|
51
|
-
>
|
|
52
|
-
</p>
|
|
53
36
|
</td>
|
|
54
37
|
</tr>
|
|
55
38
|
</table>
|
|
@@ -142,7 +125,7 @@
|
|
|
142
125
|
</a>
|
|
143
126
|
<p
|
|
144
127
|
align="center"
|
|
145
|
-
title="Hi, we're Descope! We are building something in the authentication space for app developers and can
|
|
128
|
+
title="Hi, we're Descope! We are building something in the authentication space for app developers and can't wait to place it in your hands."
|
|
146
129
|
>
|
|
147
130
|
Reduce user friction, prevent account takeover, and get a 360° view of your customer and agentic identities with the Descope External IAM platform.
|
|
148
131
|
</p>
|
|
@@ -250,7 +233,7 @@
|
|
|
250
233
|
<p
|
|
251
234
|
align="center"
|
|
252
235
|
>
|
|
253
|
-
At Buzzoid, you can buy Instagram followers
|
|
236
|
+
At Buzzoid, you can buy Instagram followers through a short checkout flow with safety controls. Rated world's #1 IG service since 2012.
|
|
254
237
|
</p>
|
|
255
238
|
<p align="center">
|
|
256
239
|
<a
|
|
@@ -288,10 +271,29 @@
|
|
|
288
271
|
</td>
|
|
289
272
|
<td align="center" width="33.333333333333336%">
|
|
290
273
|
<a
|
|
291
|
-
href="https://
|
|
274
|
+
href="https://global.fun88.com/?utm_source=axios_docs_website&utm_medium=website&utm_campaign=axios_open_collective_sponsorship"
|
|
275
|
+
style="padding: 10px; display: inline-block"
|
|
292
276
|
target="_blank"
|
|
293
|
-
>💜 Become a sponsor</a
|
|
294
277
|
>
|
|
278
|
+
<img
|
|
279
|
+
width="71px"
|
|
280
|
+
height="70px"
|
|
281
|
+
src="https://images.opencollective.com/fun88-official/bf2843c/logo.png"
|
|
282
|
+
alt="Fun 88"
|
|
283
|
+
/>
|
|
284
|
+
</a>
|
|
285
|
+
<p
|
|
286
|
+
align="center"
|
|
287
|
+
>
|
|
288
|
+
Fun88 is a global online gambling and betting brand founded in 2009, offering a wide range of services including sports betting, live casino games, slots, and virtual gaming.
|
|
289
|
+
</p>
|
|
290
|
+
<p align="center">
|
|
291
|
+
<a
|
|
292
|
+
href="https://global.fun88.com/?utm_source=axios_docs_website&utm_medium=website&utm_campaign=axios_open_collective_sponsorship"
|
|
293
|
+
target="_blank"
|
|
294
|
+
><b>global.fun88.com</b></a
|
|
295
|
+
>
|
|
296
|
+
</p>
|
|
295
297
|
</td>
|
|
296
298
|
</tr>
|
|
297
299
|
</table>
|
|
@@ -315,62 +317,61 @@
|
|
|
315
317
|
<div align="center">
|
|
316
318
|
|
|
317
319
|
[](https://www.npmjs.org/package/axios)
|
|
318
|
-
[](https://cdnjs.com/libraries/axios)
|
|
319
320
|
[](https://github.com/axios/axios/actions/workflows/ci.yml)
|
|
320
321
|
[](https://gitpod.io/#https://github.com/axios/axios)
|
|
321
|
-
[](https://coveralls.io/r/mzabriskie/axios)
|
|
322
322
|
[](https://packagephobia.now.sh/result?p=axios)
|
|
323
323
|
[](https://bundlephobia.com/package/axios@latest)
|
|
324
324
|
[](https://npm-stat.com/charts.html?package=axios)
|
|
325
325
|
[](https://gitter.im/mzabriskie/axios)
|
|
326
326
|
[](https://www.codetriage.com/axios/axios)
|
|
327
327
|
[](CONTRIBUTORS.md)
|
|
328
|
+
[](https://agentfriendlycode.com/repo/32)
|
|
328
329
|
|
|
329
330
|
</div>
|
|
330
331
|
|
|
331
|
-
## Table of
|
|
332
|
+
## Table of contents
|
|
332
333
|
|
|
333
334
|
- [Features](#features)
|
|
334
|
-
- [Browser
|
|
335
|
+
- [Browser support](#browser-support)
|
|
335
336
|
- [Installing](#installing)
|
|
336
337
|
- [Package manager](#package-manager)
|
|
337
338
|
- [CDN](#cdn)
|
|
338
339
|
- [Example](#example)
|
|
339
340
|
- [Axios API](#axios-api)
|
|
340
341
|
- [Request method aliases](#request-method-aliases)
|
|
341
|
-
- [Concurrency
|
|
342
|
+
- [Concurrency](#concurrency-deprecated)
|
|
342
343
|
- [Creating an instance](#creating-an-instance)
|
|
343
344
|
- [Instance methods](#instance-methods)
|
|
344
|
-
- [Request
|
|
345
|
-
- [Response
|
|
346
|
-
- [Config
|
|
345
|
+
- [Request config](#request-config)
|
|
346
|
+
- [Response schema](#response-schema)
|
|
347
|
+
- [Config defaults](#config-defaults)
|
|
347
348
|
- [Global axios defaults](#global-axios-defaults)
|
|
348
349
|
- [Custom instance defaults](#custom-instance-defaults)
|
|
349
350
|
- [Config order of precedence](#config-order-of-precedence)
|
|
350
351
|
- [Interceptors](#interceptors)
|
|
351
|
-
- [Multiple
|
|
352
|
-
- [Handling
|
|
353
|
-
- [Handling
|
|
352
|
+
- [Multiple interceptors](#multiple-interceptors)
|
|
353
|
+
- [Handling errors](#handling-errors)
|
|
354
|
+
- [Handling timeouts](#handling-timeouts)
|
|
354
355
|
- [Cancellation](#cancellation)
|
|
355
356
|
- [AbortController](#abortcontroller)
|
|
356
|
-
- [CancelToken
|
|
357
|
+
- [CancelToken](#canceltoken-deprecated)
|
|
357
358
|
- [Using application/x-www-form-urlencoded format](#using-applicationx-www-form-urlencoded-format)
|
|
358
359
|
- [URLSearchParams](#urlsearchparams)
|
|
359
360
|
- [Query string](#query-string-older-browsers)
|
|
360
|
-
- [
|
|
361
|
+
- [Automatic serialization](#automatic-serialization-to-urlsearchparams)
|
|
361
362
|
- [Using multipart/form-data format](#using-multipartform-data-format)
|
|
362
363
|
- [FormData](#formdata)
|
|
363
|
-
- [
|
|
364
|
-
- [
|
|
365
|
-
- [HTML
|
|
366
|
-
- [
|
|
367
|
-
- [
|
|
368
|
-
- [
|
|
369
|
-
- [
|
|
370
|
-
- [
|
|
371
|
-
- [
|
|
372
|
-
- [
|
|
373
|
-
- [
|
|
364
|
+
- [Automatic serialization](#automatic-serialization-to-formdata)
|
|
365
|
+
- [Posting files](#posting-files)
|
|
366
|
+
- [HTML form posting](#html-form-posting-browser)
|
|
367
|
+
- [Progress capturing](#progress-capturing)
|
|
368
|
+
- [Rate limiting](#rate-limiting)
|
|
369
|
+
- [AxiosHeaders](#axiosheaders)
|
|
370
|
+
- [Fetch adapter](#fetch-adapter)
|
|
371
|
+
- [Custom fetch](#custom-fetch)
|
|
372
|
+
- [Using with Tauri](#using-with-tauri)
|
|
373
|
+
- [Using with SvelteKit](#using-with-sveltekit)
|
|
374
|
+
- [HTTP/2 support](#http2-support)
|
|
374
375
|
- [Semver](#semver)
|
|
375
376
|
- [Promises](#promises)
|
|
376
377
|
- [TypeScript](#typescript)
|
|
@@ -382,17 +383,17 @@
|
|
|
382
383
|
|
|
383
384
|
## Features
|
|
384
385
|
|
|
385
|
-
-
|
|
386
|
-
-
|
|
387
|
-
-
|
|
388
|
-
-
|
|
389
|
-
-
|
|
390
|
-
-
|
|
391
|
-
-
|
|
392
|
-
-
|
|
393
|
-
-
|
|
386
|
+
- Make [XMLHttpRequests](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) from the browser.
|
|
387
|
+
- Make [http](https://nodejs.org/api/http.html) requests from Node.js.
|
|
388
|
+
- Use the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) API for asynchronous request handling.
|
|
389
|
+
- Intercept requests and responses to add custom logic or transform data.
|
|
390
|
+
- Transform request and response data.
|
|
391
|
+
- Cancel requests with built-in cancellation APIs.
|
|
392
|
+
- Serialize and parse [JSON](https://www.json.org/json-en.html) data.
|
|
393
|
+
- Serialize data objects to `multipart/form-data` or `application/x-www-form-urlencoded`.
|
|
394
|
+
- Add client-side protection against [Cross-Site Request Forgery](https://en.wikipedia.org/wiki/Cross-site_request_forgery).
|
|
394
395
|
|
|
395
|
-
## Browser
|
|
396
|
+
## Browser support
|
|
396
397
|
|
|
397
398
|
| Chrome | Firefox | Safari | Opera | Edge |
|
|
398
399
|
| :------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------: |
|
|
@@ -429,7 +430,7 @@ Using bun:
|
|
|
429
430
|
$ bun add axios
|
|
430
431
|
```
|
|
431
432
|
|
|
432
|
-
Once the package is installed,
|
|
433
|
+
Once the package is installed, import it with `import` or `require`:
|
|
433
434
|
|
|
434
435
|
```js
|
|
435
436
|
import axios, { isCancel, AxiosError } from 'axios';
|
|
@@ -451,14 +452,13 @@ const axios = require('axios');
|
|
|
451
452
|
console.log(axios.isCancel('something'));
|
|
452
453
|
```
|
|
453
454
|
|
|
454
|
-
|
|
455
|
+
Some bundlers and ES6 linters need this form:
|
|
455
456
|
|
|
456
457
|
```js
|
|
457
458
|
import { default as axios } from 'axios';
|
|
458
459
|
```
|
|
459
460
|
|
|
460
|
-
|
|
461
|
-
you can try importing the module package directly:
|
|
461
|
+
In custom or legacy environments, you can import the bundle directly:
|
|
462
462
|
|
|
463
463
|
```js
|
|
464
464
|
const axios = require('axios/dist/browser/axios.cjs'); // browser commonJS bundle (ES2017)
|
|
@@ -498,7 +498,7 @@ axios
|
|
|
498
498
|
params: {
|
|
499
499
|
ID: 12345,
|
|
500
500
|
},
|
|
501
|
-
timeout: 5000, // 5 seconds
|
|
501
|
+
timeout: 5000, // 5 seconds. See "Handling Timeouts" below for matching error handling
|
|
502
502
|
})
|
|
503
503
|
.then(function (response) {
|
|
504
504
|
console.log(response);
|
|
@@ -529,10 +529,10 @@ console.log(response);
|
|
|
529
529
|
}
|
|
530
530
|
```
|
|
531
531
|
|
|
532
|
-
>
|
|
532
|
+
> Note: Set a `timeout` in production. Without one, a stalled request can hang
|
|
533
533
|
> indefinitely. See [Handling Timeouts](#handling-timeouts) for the matching error handling.
|
|
534
534
|
|
|
535
|
-
>
|
|
535
|
+
> Note: `async/await` is part of ECMAScript 2017 and is not supported in Internet
|
|
536
536
|
> Explorer and older browsers, so use with caution.
|
|
537
537
|
|
|
538
538
|
Performing a `POST` request
|
|
@@ -617,13 +617,13 @@ For convenience, aliases have been provided for all common request methods.
|
|
|
617
617
|
|
|
618
618
|
##### axios.patch(url[, data[, config]])
|
|
619
619
|
|
|
620
|
-
######
|
|
620
|
+
###### Note
|
|
621
621
|
|
|
622
622
|
When using the alias methods `url`, `method`, and `data` properties don't need to be specified in config.
|
|
623
623
|
|
|
624
|
-
### Concurrency (
|
|
624
|
+
### Concurrency (deprecated)
|
|
625
625
|
|
|
626
|
-
|
|
626
|
+
Use `Promise.all` instead of these helpers.
|
|
627
627
|
|
|
628
628
|
Helper functions for dealing with concurrent requests.
|
|
629
629
|
|
|
@@ -646,7 +646,7 @@ const instance = axios.create({
|
|
|
646
646
|
|
|
647
647
|
### Instance methods
|
|
648
648
|
|
|
649
|
-
The
|
|
649
|
+
The following instance methods are available. Axios merges the specified config with the instance config.
|
|
650
650
|
|
|
651
651
|
##### axios#request(config)
|
|
652
652
|
|
|
@@ -666,11 +666,11 @@ The available instance methods are listed below. The specified config will be me
|
|
|
666
666
|
|
|
667
667
|
##### axios#getUri([config])
|
|
668
668
|
|
|
669
|
-
## Request
|
|
669
|
+
## Request config
|
|
670
670
|
|
|
671
|
-
###
|
|
671
|
+
### Security notice: decompression-bomb protection is opt-in
|
|
672
672
|
|
|
673
|
-
By default `maxContentLength` and `maxBodyLength` are `-1` (unlimited). A malicious or compromised server can return a tiny gzip/deflate/brotli body that expands to gigabytes and exhaust the Node.js process.
|
|
673
|
+
By default `maxContentLength` and `maxBodyLength` are `-1` (unlimited). A malicious or compromised server can return a tiny gzip/deflate/brotli/zstd body that expands to gigabytes and exhaust the Node.js process.
|
|
674
674
|
|
|
675
675
|
If you call servers you do not fully trust, **set a cap**:
|
|
676
676
|
|
|
@@ -681,17 +681,17 @@ axios.defaults.maxBodyLength = 10 * 1024 * 1024;
|
|
|
681
681
|
|
|
682
682
|
See the [security guide](https://axios.rest/pages/misc/security.html) for details.
|
|
683
683
|
|
|
684
|
-
These are
|
|
684
|
+
These config options are available for requests. Only `url` is required. Requests default to `GET` when `method` is not set.
|
|
685
685
|
|
|
686
686
|
```js
|
|
687
687
|
{
|
|
688
|
-
// `url` is the server URL
|
|
688
|
+
// `url` is the server URL for the request
|
|
689
689
|
url: '/user',
|
|
690
690
|
|
|
691
691
|
// `method` is the request method to be used when making the request
|
|
692
692
|
method: 'get', // default
|
|
693
693
|
|
|
694
|
-
// `baseURL`
|
|
694
|
+
// Axios prepends `baseURL` to `url` unless `url` is absolute and `allowAbsoluteUrls` is set to true.
|
|
695
695
|
// It can be convenient to set `baseURL` for an instance of axios to pass relative URLs
|
|
696
696
|
// to the methods of that instance.
|
|
697
697
|
baseURL: 'https://some-domain.com/api/',
|
|
@@ -720,7 +720,7 @@ These are the available config options for making requests. Only the `url` is re
|
|
|
720
720
|
return data;
|
|
721
721
|
}],
|
|
722
722
|
|
|
723
|
-
// `parseReviver` is an optional function
|
|
723
|
+
// `parseReviver` is an optional function passed as the
|
|
724
724
|
// second argument (reviver) to JSON.parse()
|
|
725
725
|
parseReviver: function (key, value, context) {
|
|
726
726
|
// In modern environments, context.source provides the raw JSON string
|
|
@@ -789,7 +789,7 @@ These are the available config options for making requests. Only the `url` is re
|
|
|
789
789
|
data: 'Country=Brasil&City=Belo Horizonte',
|
|
790
790
|
|
|
791
791
|
// `timeout` specifies the number of milliseconds before the request times out.
|
|
792
|
-
// If the request takes longer than `timeout`,
|
|
792
|
+
// If the request takes longer than `timeout`, Axios aborts it.
|
|
793
793
|
timeout: 1000, // default is `0` (no timeout)
|
|
794
794
|
|
|
795
795
|
// `withCredentials` indicates whether or not cross-site Access-Control requests
|
|
@@ -810,6 +810,12 @@ These are the available config options for making requests. Only the `url` is re
|
|
|
810
810
|
// `auth` indicates that HTTP Basic auth should be used, and supplies credentials.
|
|
811
811
|
// This will set an `Authorization` header, overwriting any existing
|
|
812
812
|
// `Authorization` custom headers you have set using `headers`.
|
|
813
|
+
// If `auth` is omitted, the Node.js HTTP and fetch adapters can read
|
|
814
|
+
// HTTP Basic auth credentials from the request URL, for example
|
|
815
|
+
// `https://user:pass@example.com`. Axios decodes percent-encoded URL
|
|
816
|
+
// credentials, and `auth` takes precedence over URL-embedded credentials.
|
|
817
|
+
// The Node.js HTTP adapter preserves Basic auth on same-origin redirects
|
|
818
|
+
// and strips it on cross-origin redirects.
|
|
813
819
|
// Please note that only HTTP Basic auth is configurable through this parameter.
|
|
814
820
|
// For Bearer tokens and such, use `Authorization` custom headers instead.
|
|
815
821
|
auth: {
|
|
@@ -883,17 +889,16 @@ These are the available config options for making requests. Only the `url` is re
|
|
|
883
889
|
|
|
884
890
|
// `validateStatus` defines whether to resolve or reject the promise for a given
|
|
885
891
|
// HTTP response status code. If `validateStatus` returns `true` (or is set to `null`
|
|
886
|
-
// or `undefined`), the promise
|
|
887
|
-
// rejected.
|
|
892
|
+
// or `undefined`), Axios resolves the promise; otherwise, Axios rejects it.
|
|
888
893
|
validateStatus: function (status) {
|
|
889
894
|
return status >= 200 && status < 300; // default
|
|
890
895
|
},
|
|
891
896
|
|
|
892
897
|
// `maxRedirects` defines the maximum number of redirects to follow in node.js.
|
|
893
|
-
// If set to 0, no redirects
|
|
898
|
+
// If set to 0, Axios follows no redirects.
|
|
894
899
|
maxRedirects: 21, // default
|
|
895
900
|
|
|
896
|
-
// `beforeRedirect` defines a function that
|
|
901
|
+
// `beforeRedirect` defines a function that Axios calls before redirect.
|
|
897
902
|
// Use this to adjust the request options upon redirecting,
|
|
898
903
|
// to inspect the latest response headers,
|
|
899
904
|
// or to cancel the request by throwing an error
|
|
@@ -909,16 +914,10 @@ These are the available config options for making requests. Only the `url` is re
|
|
|
909
914
|
},
|
|
910
915
|
// Security note:
|
|
911
916
|
// The `beforeRedirect` hook runs after sensitive headers are stripped during redirects.
|
|
912
|
-
//
|
|
913
|
-
//
|
|
914
|
-
//
|
|
915
|
-
|
|
916
|
-
// Security note:
|
|
917
|
-
// The beforeRedirect hook runs after sensitive headers are stripped during redirects.
|
|
918
|
-
// Re-injecting credentials without checking the destination can expose sensitive data.
|
|
919
|
-
// Only add credentials for trusted HTTPS destinations.
|
|
920
|
-
// Avoid re-adding credentials on downgraded redirects.
|
|
921
|
-
|
|
917
|
+
// `follow-redirects` removes credentials on protocol downgrades
|
|
918
|
+
// (HTTPS to HTTP). Because `beforeRedirect` runs after that step,
|
|
919
|
+
// re-injecting credentials without checking the destination can expose
|
|
920
|
+
// sensitive data. Only add credentials for trusted HTTPS destinations.
|
|
922
921
|
|
|
923
922
|
// `socketPath` defines a UNIX Socket to be used in node.js.
|
|
924
923
|
// e.g. '/var/run/docker.sock' to send requests to the docker daemon.
|
|
@@ -937,10 +936,10 @@ These are the available config options for making requests. Only the `url` is re
|
|
|
937
936
|
// `ERR_BAD_OPTION_VALUE`. When null/undefined, no restriction is applied.
|
|
938
937
|
allowedSocketPaths: null, // default
|
|
939
938
|
|
|
940
|
-
// `transport` determines the transport method
|
|
941
|
-
// If defined,
|
|
942
|
-
// the default `http` or `https` library
|
|
943
|
-
// Otherwise, the `httpFollow` or `httpsFollow` library
|
|
939
|
+
// `transport` determines the transport method for the request.
|
|
940
|
+
// If defined, Axios uses it. Otherwise, if `maxRedirects` is 0,
|
|
941
|
+
// Axios uses the default `http` or `https` library, depending on the protocol specified in `protocol`.
|
|
942
|
+
// Otherwise, Axios uses the `httpFollow` or `httpsFollow` library, again depending on the protocol,
|
|
944
943
|
// which can handle redirects.
|
|
945
944
|
transport: undefined, // default
|
|
946
945
|
|
|
@@ -966,12 +965,15 @@ These are the available config options for making requests. Only the `url` is re
|
|
|
966
965
|
// For `https://` targets, axios establishes a CONNECT tunnel through the
|
|
967
966
|
// proxy and performs TLS end-to-end with the origin; `Proxy-Authorization`
|
|
968
967
|
// is sent on the CONNECT request only, never on the wrapped TLS request,
|
|
969
|
-
// so the proxy never sees the URL, headers, or body.
|
|
970
|
-
// `httpsAgent`
|
|
968
|
+
// so the proxy never sees the URL, headers, or body. Axios forwards
|
|
969
|
+
// `httpsAgent` TLS options such as `ca`, `cert`, `key`, and
|
|
970
|
+
// `rejectUnauthorized` to the generated tunneling agent, so they still apply
|
|
971
|
+
// to the origin TLS connection.
|
|
972
|
+
// If you supply an `HttpsProxyAgent`, axios leaves tunneling to that agent.
|
|
971
973
|
// If the proxy server uses HTTPS, then you must set the protocol to `https`.
|
|
972
974
|
// A user-supplied `Host` header in `headers` is preserved when forwarding
|
|
973
975
|
// through a proxy (case-insensitive match on `host`/`Host`/`HOST`); this
|
|
974
|
-
// lets you target a virtual host that differs from the request URL
|
|
976
|
+
// lets you target a virtual host that differs from the request URL, for
|
|
975
977
|
// example, hitting `127.0.0.1:4000` while having the proxy treat the
|
|
976
978
|
// request as `example.com`. If no `Host` header is supplied, axios
|
|
977
979
|
// defaults it to the request URL's `hostname:port` as before. The Host
|
|
@@ -1000,6 +1002,8 @@ These are the available config options for making requests. Only the `url` is re
|
|
|
1000
1002
|
// `decompress` indicates whether or not the response body should be decompressed
|
|
1001
1003
|
// automatically. If set to `true` will also remove the 'content-encoding' header
|
|
1002
1004
|
// from the responses objects of all decompressed responses
|
|
1005
|
+
// Axios supports gzip, deflate, brotli, and zstd when the current Node.js
|
|
1006
|
+
// runtime provides the corresponding zlib decompressor.
|
|
1003
1007
|
// - Node only (XHR cannot turn off decompression)
|
|
1004
1008
|
decompress: true, // default
|
|
1005
1009
|
|
|
@@ -1029,6 +1033,11 @@ These are the available config options for making requests. Only the `url` is re
|
|
|
1029
1033
|
// throw ETIMEDOUT error instead of generic ECONNABORTED on request timeouts
|
|
1030
1034
|
clarifyTimeoutError: false,
|
|
1031
1035
|
|
|
1036
|
+
// advertise `zstd` in the default Accept-Encoding header when the current
|
|
1037
|
+
// Node.js runtime supports zstd decompression. Axios still decompresses
|
|
1038
|
+
// zstd responses when support exists and `decompress` is true.
|
|
1039
|
+
advertiseZstdAcceptEncoding: false,
|
|
1040
|
+
|
|
1032
1041
|
// use the legacy interceptor request/response ordering
|
|
1033
1042
|
legacyInterceptorReqResOrdering: true, // default
|
|
1034
1043
|
},
|
|
@@ -1073,17 +1082,17 @@ const client = axios.create({
|
|
|
1073
1082
|
});
|
|
1074
1083
|
```
|
|
1075
1084
|
|
|
1076
|
-
##
|
|
1085
|
+
## HTTP/2 support
|
|
1077
1086
|
|
|
1078
|
-
Axios has experimental HTTP/2 support
|
|
1087
|
+
Axios has experimental HTTP/2 support in the Node.js HTTP adapter.
|
|
1079
1088
|
|
|
1080
|
-
Support depends on the runtime environment and Node.js version.
|
|
1089
|
+
Support depends on the runtime environment and Node.js version. Redirects and some adapter behavior may differ from HTTP/1.1.
|
|
1081
1090
|
|
|
1082
|
-
Options like `httpVersion` and `http2Options` are adapter-specific and may not work
|
|
1091
|
+
Options like `httpVersion` and `http2Options` are adapter-specific and may not work the same way in every environment.
|
|
1083
1092
|
|
|
1084
|
-
If HTTP/2
|
|
1093
|
+
If you need HTTP/2, check runtime support or use a custom adapter.
|
|
1085
1094
|
|
|
1086
|
-
## Response
|
|
1095
|
+
## Response schema
|
|
1087
1096
|
|
|
1088
1097
|
The response to a request contains the following information.
|
|
1089
1098
|
|
|
@@ -1113,7 +1122,7 @@ The response to a request contains the following information.
|
|
|
1113
1122
|
}
|
|
1114
1123
|
```
|
|
1115
1124
|
|
|
1116
|
-
When using `then`, you
|
|
1125
|
+
When using `then`, you receive the response like this:
|
|
1117
1126
|
|
|
1118
1127
|
```js
|
|
1119
1128
|
const response = await axios.get('/user/12345');
|
|
@@ -1124,18 +1133,18 @@ console.log(response.headers);
|
|
|
1124
1133
|
console.log(response.config);
|
|
1125
1134
|
```
|
|
1126
1135
|
|
|
1127
|
-
When using `catch`, or passing a [rejection callback](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) as second parameter of `then`, the response
|
|
1136
|
+
When using `catch`, or passing a [rejection callback](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) as the second parameter of `then`, read the response from the `error` object. See [Handling errors](#handling-errors).
|
|
1128
1137
|
|
|
1129
|
-
## Config
|
|
1138
|
+
## Config defaults
|
|
1130
1139
|
|
|
1131
|
-
|
|
1140
|
+
Config defaults apply to every request.
|
|
1132
1141
|
|
|
1133
1142
|
### Global axios defaults
|
|
1134
1143
|
|
|
1135
1144
|
```js
|
|
1136
1145
|
axios.defaults.baseURL = 'https://api.example.com';
|
|
1137
1146
|
|
|
1138
|
-
// Important: If
|
|
1147
|
+
// Important: If you use axios with multiple domains, Axios sends AUTH_TOKEN to all of them.
|
|
1139
1148
|
// See below for an example using Custom instance defaults instead.
|
|
1140
1149
|
axios.defaults.headers.common['Authorization'] = AUTH_TOKEN;
|
|
1141
1150
|
|
|
@@ -1156,7 +1165,7 @@ instance.defaults.headers.common['Authorization'] = AUTH_TOKEN;
|
|
|
1156
1165
|
|
|
1157
1166
|
### Config order of precedence
|
|
1158
1167
|
|
|
1159
|
-
|
|
1168
|
+
Axios merges config in this order: library defaults from [lib/defaults/index.js](https://github.com/axios/axios/blob/main/lib/defaults/index.js#L49), the instance `defaults` property, and the request `config` argument. Later values take precedence over earlier ones.
|
|
1160
1169
|
|
|
1161
1170
|
```js
|
|
1162
1171
|
// Create an instance using the config defaults provided by the library
|
|
@@ -1258,8 +1267,8 @@ axios.interceptors.request.use(
|
|
|
1258
1267
|
```
|
|
1259
1268
|
|
|
1260
1269
|
If you want to execute a particular interceptor based on a runtime check,
|
|
1261
|
-
you can add a `runWhen` function to the options object. The request interceptor will not
|
|
1262
|
-
of `runWhen` is `false`.
|
|
1270
|
+
you can add a `runWhen` function to the options object. The request interceptor will not run **if and only if** the return
|
|
1271
|
+
of `runWhen` is `false`. Axios calls the function with the config
|
|
1263
1272
|
object (don't forget that you can bind your own arguments to it as well.) This can be handy when you have an
|
|
1264
1273
|
asynchronous request interceptor that only needs to run at certain times.
|
|
1265
1274
|
|
|
@@ -1277,15 +1286,15 @@ axios.interceptors.request.use(
|
|
|
1277
1286
|
);
|
|
1278
1287
|
```
|
|
1279
1288
|
|
|
1280
|
-
>
|
|
1289
|
+
> Note: The options parameter (with `synchronous` and `runWhen` properties) is only supported for request interceptors at the moment.
|
|
1281
1290
|
|
|
1282
|
-
### Interceptor
|
|
1291
|
+
### Interceptor execution order
|
|
1283
1292
|
|
|
1284
|
-
|
|
1293
|
+
Request and response interceptors use different execution orders.
|
|
1285
1294
|
|
|
1286
|
-
Request interceptors
|
|
1295
|
+
Request interceptors run in reverse order (LIFO: last in, first out). The last interceptor added runs first.
|
|
1287
1296
|
|
|
1288
|
-
Response interceptors
|
|
1297
|
+
Response interceptors run in the order they were added (FIFO: first in, first out). The first interceptor added runs first.
|
|
1289
1298
|
|
|
1290
1299
|
Example:
|
|
1291
1300
|
|
|
@@ -1314,37 +1323,33 @@ instance.interceptors.response.use(interceptor('Response Interceptor 3'));
|
|
|
1314
1323
|
// Response Interceptor 3
|
|
1315
1324
|
```
|
|
1316
1325
|
|
|
1317
|
-
### Multiple
|
|
1326
|
+
### Multiple interceptors
|
|
1318
1327
|
|
|
1319
|
-
|
|
1320
|
-
and when the response was fulfilled
|
|
1328
|
+
When a response is fulfilled and multiple response interceptors are registered:
|
|
1321
1329
|
|
|
1322
|
-
-
|
|
1323
|
-
-
|
|
1324
|
-
-
|
|
1325
|
-
-
|
|
1326
|
-
-
|
|
1327
|
-
- then the following fulfillment-interceptor is not called
|
|
1328
|
-
- then the following rejection-interceptor is called
|
|
1329
|
-
- once caught, another following fulfill-interceptor is called again (just like in a promise chain).
|
|
1330
|
+
- Each interceptor runs in registration order.
|
|
1331
|
+
- Each interceptor receives the result from the previous interceptor.
|
|
1332
|
+
- The chain returns the result from the last interceptor.
|
|
1333
|
+
- If a fulfillment interceptor throws, Axios skips the next fulfillment interceptor and calls the next rejection interceptor.
|
|
1334
|
+
- After the error is caught, later fulfillment interceptors run again, just like in a promise chain.
|
|
1330
1335
|
|
|
1331
1336
|
Read [the interceptor tests](./test/specs/interceptors.spec.js) to see all this in code.
|
|
1332
1337
|
|
|
1333
|
-
## Error
|
|
1338
|
+
## Error types
|
|
1334
1339
|
|
|
1335
|
-
|
|
1340
|
+
Axios error messages include details that can help you debug the request.
|
|
1336
1341
|
|
|
1337
|
-
|
|
1342
|
+
Axios errors use this structure:
|
|
1338
1343
|
| Property | Definition |
|
|
1339
1344
|
| -------- | ---------- |
|
|
1340
1345
|
| message | A quick summary of the error message and the status it failed with. |
|
|
1341
1346
|
| name | This defines where the error originated from. For axios, it will always be an 'AxiosError'. |
|
|
1342
|
-
| stack |
|
|
1347
|
+
| stack | Stack trace for the error. |
|
|
1343
1348
|
| config | An axios config object with specific instance configurations defined by the user from when the request was made |
|
|
1344
|
-
| code |
|
|
1349
|
+
| code | Axios error code. The table below lists internal Axios error codes. |
|
|
1345
1350
|
| status | HTTP response status code. See [here](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) for common HTTP response status code meanings.
|
|
1346
1351
|
|
|
1347
|
-
|
|
1352
|
+
These are the internal Axios error codes:
|
|
1348
1353
|
|
|
1349
1354
|
| Code | Definition |
|
|
1350
1355
|
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -1354,16 +1359,16 @@ Below is a list of potential axios identified error:
|
|
|
1354
1359
|
| ERR_DEPRECATED | Deprecated feature or method used in axios. |
|
|
1355
1360
|
| ERR_INVALID_URL | Invalid URL provided for axios request. |
|
|
1356
1361
|
| ECONNABORTED | Typically indicates that the request has been timed out (unless `transitional.clarifyTimeoutError` is set) or aborted by the browser or its plugin. |
|
|
1357
|
-
| ERR_CANCELED |
|
|
1358
|
-
| ETIMEDOUT | Request timed out
|
|
1362
|
+
| ERR_CANCELED | The user explicitly canceled the request with an AbortSignal or CancelToken. |
|
|
1363
|
+
| ETIMEDOUT | Request timed out after exceeding the configured Axios timeout. Set `transitional.clarifyTimeoutError` to `true`; otherwise Axios throws a generic `ECONNABORTED` error. |
|
|
1359
1364
|
| ERR_NETWORK | Network-related issue. In the browser, this error can also be caused by a [CORS](https://developer.mozilla.org/ru/docs/Web/HTTP/Guides/CORS) or [Mixed Content](https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content) policy violation. The browser does not allow the JS code to clarify the real reason for the error caused by security issues, so please check the console. |
|
|
1360
|
-
| ERR_FR_TOO_MANY_REDIRECTS | Request
|
|
1365
|
+
| ERR_FR_TOO_MANY_REDIRECTS | Request exceeded the configured maximum number of redirects. |
|
|
1361
1366
|
| ERR_BAD_RESPONSE | Response cannot be parsed properly or is in an unexpected format. Usually related to a response with `5xx` status code. |
|
|
1362
1367
|
| ERR_BAD_REQUEST | The request has an unexpected format or is missing required parameters. Usually related to a response with `4xx` status code. |
|
|
1363
1368
|
|
|
1364
|
-
## Handling
|
|
1369
|
+
## Handling errors
|
|
1365
1370
|
|
|
1366
|
-
|
|
1371
|
+
By default, Axios rejects responses with status codes outside the 2xx range.
|
|
1367
1372
|
|
|
1368
1373
|
```js
|
|
1369
1374
|
axios.get('/user/12345').catch(function (error) {
|
|
@@ -1386,7 +1391,7 @@ axios.get('/user/12345').catch(function (error) {
|
|
|
1386
1391
|
});
|
|
1387
1392
|
```
|
|
1388
1393
|
|
|
1389
|
-
|
|
1394
|
+
Use `validateStatus` to override the default condition (`status >= 200 && status < 300`) and choose which HTTP status codes should reject.
|
|
1390
1395
|
|
|
1391
1396
|
```js
|
|
1392
1397
|
axios.get('/user/12345', {
|
|
@@ -1396,7 +1401,7 @@ axios.get('/user/12345', {
|
|
|
1396
1401
|
});
|
|
1397
1402
|
```
|
|
1398
1403
|
|
|
1399
|
-
|
|
1404
|
+
Use `toJSON` to get more information about the HTTP error.
|
|
1400
1405
|
|
|
1401
1406
|
```js
|
|
1402
1407
|
axios.get('/user/12345').catch(function (error) {
|
|
@@ -1415,7 +1420,7 @@ axios.get('/user/12345', {
|
|
|
1415
1420
|
});
|
|
1416
1421
|
```
|
|
1417
1422
|
|
|
1418
|
-
## Handling
|
|
1423
|
+
## Handling timeouts
|
|
1419
1424
|
|
|
1420
1425
|
```js
|
|
1421
1426
|
async function fetchWithTimeout() {
|
|
@@ -1449,7 +1454,7 @@ async function fetchWithTimeout() {
|
|
|
1449
1454
|
|
|
1450
1455
|
### AbortController
|
|
1451
1456
|
|
|
1452
|
-
|
|
1457
|
+
Since `v0.22.0`, Axios supports AbortController:
|
|
1453
1458
|
|
|
1454
1459
|
```js
|
|
1455
1460
|
const controller = new AbortController();
|
|
@@ -1465,15 +1470,15 @@ axios
|
|
|
1465
1470
|
controller.abort();
|
|
1466
1471
|
```
|
|
1467
1472
|
|
|
1468
|
-
### CancelToken
|
|
1473
|
+
### CancelToken (deprecated)
|
|
1469
1474
|
|
|
1470
1475
|
You can also cancel a request using a _CancelToken_.
|
|
1471
1476
|
|
|
1472
1477
|
> The axios cancel token API is based on the withdrawn [cancellable promises proposal](https://github.com/tc39/proposal-cancelable-promises).
|
|
1473
1478
|
|
|
1474
|
-
> This API is deprecated since v0.22.0 and
|
|
1479
|
+
> This API is deprecated since v0.22.0 and should not be used in new projects.
|
|
1475
1480
|
|
|
1476
|
-
|
|
1481
|
+
Create a cancel token with the `CancelToken.source` factory:
|
|
1477
1482
|
|
|
1478
1483
|
```js
|
|
1479
1484
|
const CancelToken = axios.CancelToken;
|
|
@@ -1505,7 +1510,7 @@ axios.post(
|
|
|
1505
1510
|
source.cancel('Operation canceled by the user.');
|
|
1506
1511
|
```
|
|
1507
1512
|
|
|
1508
|
-
You can also
|
|
1513
|
+
You can also pass an executor function to the `CancelToken` constructor:
|
|
1509
1514
|
|
|
1510
1515
|
```js
|
|
1511
1516
|
const CancelToken = axios.CancelToken;
|
|
@@ -1522,8 +1527,8 @@ axios.get('/user/12345', {
|
|
|
1522
1527
|
cancel();
|
|
1523
1528
|
```
|
|
1524
1529
|
|
|
1525
|
-
>
|
|
1526
|
-
> If a cancellation token is already cancelled
|
|
1530
|
+
> Note: You can cancel several requests with the same cancel token or abort controller.
|
|
1531
|
+
> If a cancellation token is already cancelled when an Axios request starts, Axios cancels the request immediately without making a real request.
|
|
1527
1532
|
|
|
1528
1533
|
> During the transition period, you can use both cancellation APIs, even for the same request:
|
|
1529
1534
|
|
|
@@ -1531,7 +1536,7 @@ cancel();
|
|
|
1531
1536
|
|
|
1532
1537
|
### URLSearchParams
|
|
1533
1538
|
|
|
1534
|
-
By default, axios serializes JavaScript objects to `JSON`. To send data
|
|
1539
|
+
By default, axios serializes JavaScript objects to `JSON`. To send data as [`application/x-www-form-urlencoded`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST), use the [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) API. It works in most browsers and in [Node](https://nodejs.org/api/url.html#url_class_urlsearchparams) v10 and later.
|
|
1535
1540
|
|
|
1536
1541
|
```js
|
|
1537
1542
|
const params = new URLSearchParams({ foo: 'bar' });
|
|
@@ -1539,9 +1544,9 @@ params.append('extraparam', 'value');
|
|
|
1539
1544
|
axios.post('/foo', params);
|
|
1540
1545
|
```
|
|
1541
1546
|
|
|
1542
|
-
### Query string (
|
|
1547
|
+
### Query string (older browsers)
|
|
1543
1548
|
|
|
1544
|
-
For
|
|
1549
|
+
For very old browsers, use a [polyfill](https://github.com/WebReflection/url-search-params) and make sure it patches the global environment.
|
|
1545
1550
|
|
|
1546
1551
|
Alternatively, you can encode data using the [`qs`](https://github.com/ljharb/qs) library:
|
|
1547
1552
|
|
|
@@ -1550,7 +1555,7 @@ const qs = require('qs');
|
|
|
1550
1555
|
axios.post('/foo', qs.stringify({ bar: 123 }));
|
|
1551
1556
|
```
|
|
1552
1557
|
|
|
1553
|
-
|
|
1558
|
+
With ES modules:
|
|
1554
1559
|
|
|
1555
1560
|
```js
|
|
1556
1561
|
import qs from 'qs';
|
|
@@ -1566,7 +1571,7 @@ axios(options);
|
|
|
1566
1571
|
|
|
1567
1572
|
### Older Node.js versions
|
|
1568
1573
|
|
|
1569
|
-
For older Node.js engines,
|
|
1574
|
+
For older Node.js engines, use the [`querystring`](https://nodejs.org/api/querystring.html) module:
|
|
1570
1575
|
|
|
1571
1576
|
```js
|
|
1572
1577
|
const querystring = require('querystring');
|
|
@@ -1575,11 +1580,11 @@ axios.post('https://something.com/', querystring.stringify({ foo: 'bar' }));
|
|
|
1575
1580
|
|
|
1576
1581
|
You can also use the [`qs`](https://github.com/ljharb/qs) library.
|
|
1577
1582
|
|
|
1578
|
-
>
|
|
1583
|
+
> Note: The `qs` library is preferable if you need to stringify nested objects, as the `querystring` method has [known issues](https://github.com/nodejs/node-v0.x-archive/issues/1665) with that use case.
|
|
1579
1584
|
|
|
1580
|
-
###
|
|
1585
|
+
### Automatic serialization to URLSearchParams
|
|
1581
1586
|
|
|
1582
|
-
Axios
|
|
1587
|
+
Axios automatically serializes the data object to urlencoded format if the content-type header is set to "application/x-www-form-urlencoded".
|
|
1583
1588
|
|
|
1584
1589
|
```js
|
|
1585
1590
|
const data = {
|
|
@@ -1597,7 +1602,7 @@ await axios.postForm('https://postman-echo.com/post', data, {
|
|
|
1597
1602
|
});
|
|
1598
1603
|
```
|
|
1599
1604
|
|
|
1600
|
-
The server
|
|
1605
|
+
The server receives these fields:
|
|
1601
1606
|
|
|
1602
1607
|
```js
|
|
1603
1608
|
{
|
|
@@ -1614,7 +1619,7 @@ The server will handle it as:
|
|
|
1614
1619
|
}
|
|
1615
1620
|
```
|
|
1616
1621
|
|
|
1617
|
-
If your backend body
|
|
1622
|
+
If your backend body parser, such as `body-parser` for `express.js`, supports nested object decoding, the server receives the same object structure:
|
|
1618
1623
|
|
|
1619
1624
|
```js
|
|
1620
1625
|
const app = express();
|
|
@@ -1633,8 +1638,8 @@ server = app.listen(3000);
|
|
|
1633
1638
|
|
|
1634
1639
|
### FormData
|
|
1635
1640
|
|
|
1636
|
-
To send
|
|
1637
|
-
|
|
1641
|
+
To send data as `multipart/form-data`, pass a FormData instance as the payload.
|
|
1642
|
+
You do not need to set the `Content-Type` header. Axios detects it from the payload type.
|
|
1638
1643
|
|
|
1639
1644
|
```js
|
|
1640
1645
|
const formData = new FormData();
|
|
@@ -1643,7 +1648,7 @@ formData.append('foo', 'bar');
|
|
|
1643
1648
|
axios.post('https://httpbin.org/post', formData);
|
|
1644
1649
|
```
|
|
1645
1650
|
|
|
1646
|
-
In node.js,
|
|
1651
|
+
In node.js, use the [`form-data`](https://github.com/form-data/form-data) library:
|
|
1647
1652
|
|
|
1648
1653
|
```js
|
|
1649
1654
|
const FormData = require('form-data');
|
|
@@ -1658,12 +1663,12 @@ axios.post('https://example.com', form);
|
|
|
1658
1663
|
|
|
1659
1664
|
In node.js, when a `FormData` object provides `getHeaders()`, axios copies all returned headers by default for v1 compatibility. If the `FormData` object is custom or not fully trusted, set `formDataHeaderPolicy: 'content-only'` to copy only `Content-Type` and `Content-Length`, and set any other request headers explicitly with the request `headers` config.
|
|
1660
1665
|
|
|
1661
|
-
###
|
|
1666
|
+
### Automatic serialization to FormData
|
|
1662
1667
|
|
|
1663
|
-
|
|
1668
|
+
Since `v0.27.0`, Axios can serialize an object to FormData if the request `Content-Type`
|
|
1664
1669
|
header is set to `multipart/form-data`.
|
|
1665
1670
|
|
|
1666
|
-
|
|
1671
|
+
This request submits data as FormData in browsers and Node.js:
|
|
1667
1672
|
|
|
1668
1673
|
```js
|
|
1669
1674
|
import axios from 'axios';
|
|
@@ -1681,10 +1686,9 @@ axios
|
|
|
1681
1686
|
.then(({ data }) => console.log(data));
|
|
1682
1687
|
```
|
|
1683
1688
|
|
|
1684
|
-
|
|
1689
|
+
The Node.js build uses the [`form-data`](https://github.com/form-data/form-data) polyfill by default.
|
|
1685
1690
|
|
|
1686
|
-
You can
|
|
1687
|
-
but you probably won't need it in most cases:
|
|
1691
|
+
You can override the FormData class with the `env.FormData` config option, but most applications do not need this:
|
|
1688
1692
|
|
|
1689
1693
|
```js
|
|
1690
1694
|
const axios = require('axios');
|
|
@@ -1703,30 +1707,30 @@ axios
|
|
|
1703
1707
|
.then(({ data }) => console.log(data));
|
|
1704
1708
|
```
|
|
1705
1709
|
|
|
1706
|
-
Axios FormData serializer supports
|
|
1710
|
+
The Axios FormData serializer supports these special endings:
|
|
1707
1711
|
|
|
1708
1712
|
- `{}` - serialize the value with JSON.stringify
|
|
1709
1713
|
- `[]` - unwrap the array-like object as separate fields with the same key
|
|
1710
1714
|
|
|
1711
|
-
>
|
|
1715
|
+
> Note: Arrays and FileList objects are unwrapped by default.
|
|
1712
1716
|
|
|
1713
1717
|
FormData serializer supports additional options via `config.formSerializer: object` property to handle rare cases:
|
|
1714
1718
|
|
|
1715
|
-
- `visitor: Function` - user-defined visitor function that
|
|
1719
|
+
- `visitor: Function` - user-defined visitor function that Axios calls recursively to serialize the data object
|
|
1716
1720
|
to a `FormData` object by following custom rules.
|
|
1717
1721
|
|
|
1718
1722
|
- `dots: boolean = false` - use dot notation instead of brackets to serialize arrays and objects;
|
|
1719
1723
|
|
|
1720
1724
|
- `metaTokens: boolean = true` - add the special ending (e.g `user{}: '{"name": "John"}'`) in the FormData key.
|
|
1721
|
-
|
|
1725
|
+
A backend body parser can use this meta-information to parse the value as JSON.
|
|
1722
1726
|
|
|
1723
|
-
- `indexes: null|false|true = false` - controls how
|
|
1727
|
+
- `indexes: null|false|true = false` - controls how Axios adds indexes to unwrapped keys of `flat` array-like objects.
|
|
1724
1728
|
- `null` - don't add brackets (`arr: 1`, `arr: 2`, `arr: 3`)
|
|
1725
1729
|
- `false`(default) - add empty brackets (`arr[]: 1`, `arr[]: 2`, `arr[]: 3`)
|
|
1726
1730
|
- `true` - add brackets with indexes (`arr[0]: 1`, `arr[1]: 2`, `arr[2]: 3`)
|
|
1727
1731
|
- `maxDepth: number = 100` - maximum object nesting depth the serializer will recurse into. If the
|
|
1728
1732
|
input object exceeds this depth, an `AxiosError` with `code: 'ERR_FORM_DATA_DEPTH_EXCEEDED'` is
|
|
1729
|
-
thrown instead of overflowing the call stack. This protects server
|
|
1733
|
+
thrown instead of overflowing the call stack. This protects server applications from DoS
|
|
1730
1734
|
attacks via deeply nested payloads. Set to `Infinity` to disable the limit and restore pre-fix behaviour.
|
|
1731
1735
|
|
|
1732
1736
|
```js
|
|
@@ -1737,7 +1741,7 @@ axios.postForm('/api', data, { formSerializer: { maxDepth: 200 } });
|
|
|
1737
1741
|
axios.get('/api', { params: data, paramsSerializer: { maxDepth: 200 } });
|
|
1738
1742
|
```
|
|
1739
1743
|
|
|
1740
|
-
|
|
1744
|
+
Given this object:
|
|
1741
1745
|
|
|
1742
1746
|
```js
|
|
1743
1747
|
const obj = {
|
|
@@ -1752,7 +1756,7 @@ const obj = {
|
|
|
1752
1756
|
};
|
|
1753
1757
|
```
|
|
1754
1758
|
|
|
1755
|
-
The
|
|
1759
|
+
The Axios serializer appends these fields:
|
|
1756
1760
|
|
|
1757
1761
|
```js
|
|
1758
1762
|
const formData = new FormData();
|
|
@@ -1770,12 +1774,11 @@ formData.append('users[1][surname]', 'Anderson');
|
|
|
1770
1774
|
formData.append('obj2{}', '[{"x":1}]');
|
|
1771
1775
|
```
|
|
1772
1776
|
|
|
1773
|
-
Axios supports
|
|
1774
|
-
which are just the corresponding http methods with the `Content-Type` header preset to `multipart/form-data`.
|
|
1777
|
+
Axios supports `postForm`, `putForm`, and `patchForm` as shortcuts for the matching HTTP methods with the `Content-Type` header preset to `multipart/form-data`.
|
|
1775
1778
|
|
|
1776
|
-
##
|
|
1779
|
+
## Posting files
|
|
1777
1780
|
|
|
1778
|
-
|
|
1781
|
+
Submit a single file:
|
|
1779
1782
|
|
|
1780
1783
|
```js
|
|
1781
1784
|
await axios.postForm('https://httpbin.org/post', {
|
|
@@ -1798,9 +1801,9 @@ await axios.postForm('https://httpbin.org/post', {
|
|
|
1798
1801
|
await axios.postForm('https://httpbin.org/post', document.querySelector('#fileInput').files);
|
|
1799
1802
|
```
|
|
1800
1803
|
|
|
1801
|
-
|
|
1804
|
+
Axios sends all files with the same field name: `files[]`.
|
|
1802
1805
|
|
|
1803
|
-
##
|
|
1806
|
+
## HTML form posting (browser)
|
|
1804
1807
|
|
|
1805
1808
|
Pass an HTML Form element as a payload to submit it as `multipart/form-data` content.
|
|
1806
1809
|
|
|
@@ -1838,7 +1841,7 @@ For example, the Form
|
|
|
1838
1841
|
</form>
|
|
1839
1842
|
```
|
|
1840
1843
|
|
|
1841
|
-
|
|
1844
|
+
submits this JSON object:
|
|
1842
1845
|
|
|
1843
1846
|
```js
|
|
1844
1847
|
{
|
|
@@ -1860,10 +1863,10 @@ will be submitted as the following JSON object:
|
|
|
1860
1863
|
|
|
1861
1864
|
Sending `Blobs`/`Files` as JSON (`base64`) is not currently supported.
|
|
1862
1865
|
|
|
1863
|
-
##
|
|
1866
|
+
## Progress capturing
|
|
1864
1867
|
|
|
1865
|
-
Axios
|
|
1866
|
-
|
|
1868
|
+
Axios can capture request upload and download progress in browsers and Node.js.
|
|
1869
|
+
Progress events are limited to `3` times per second.
|
|
1867
1870
|
|
|
1868
1871
|
```js
|
|
1869
1872
|
await axios.post(url, data, {
|
|
@@ -1909,14 +1912,14 @@ const { data } = await axios.post(SERVER_URL, readableStream, {
|
|
|
1909
1912
|
});
|
|
1910
1913
|
```
|
|
1911
1914
|
|
|
1912
|
-
>
|
|
1915
|
+
> Note:
|
|
1913
1916
|
> Capturing FormData upload progress is not currently supported in node.js environments.
|
|
1914
1917
|
|
|
1915
|
-
>
|
|
1916
|
-
>
|
|
1917
|
-
>
|
|
1918
|
+
> Warning:
|
|
1919
|
+
> Set `maxRedirects: 0` when uploading streams in node.js.
|
|
1920
|
+
> The follow-redirects package buffers the entire stream in RAM and does not follow the "backpressure" algorithm.
|
|
1918
1921
|
|
|
1919
|
-
##
|
|
1922
|
+
## Rate limiting
|
|
1920
1923
|
|
|
1921
1924
|
Download and upload rate limits can only be set for the http adapter (node.js):
|
|
1922
1925
|
|
|
@@ -1930,25 +1933,24 @@ const { data } = await axios.post(LOCAL_SERVER_URL, myBuffer, {
|
|
|
1930
1933
|
});
|
|
1931
1934
|
```
|
|
1932
1935
|
|
|
1933
|
-
##
|
|
1936
|
+
## AxiosHeaders
|
|
1934
1937
|
|
|
1935
|
-
Axios
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
The old approach of directly manipulating the headers object is still available, but deprecated and not recommended for future usage.
|
|
1938
|
+
Axios includes an `AxiosHeaders` class for working with headers through a Map-like API.
|
|
1939
|
+
HTTP header names are case-insensitive, but Axios keeps the original header case for style and for servers that incorrectly depend on case.
|
|
1940
|
+
Directly manipulating the headers object still works, but it is deprecated.
|
|
1939
1941
|
|
|
1940
1942
|
### Working with headers
|
|
1941
1943
|
|
|
1942
|
-
An AxiosHeaders
|
|
1943
|
-
|
|
1944
|
+
An `AxiosHeaders` instance can contain several internal value types that control setting and merging.
|
|
1945
|
+
Axios gets the final headers object with string values by calling `toJSON`.
|
|
1944
1946
|
|
|
1945
1947
|
> Note: By JSON here we mean an object consisting only of string values intended to be sent over the network.
|
|
1946
1948
|
|
|
1947
1949
|
The header value can be one of the following types:
|
|
1948
1950
|
|
|
1949
|
-
- `string` - normal string value
|
|
1951
|
+
- `string` - normal string value sent to the server
|
|
1950
1952
|
- `null` - skip header when rendering to JSON
|
|
1951
|
-
- `false` - skip header when rendering to JSON
|
|
1953
|
+
- `false` - skip header when rendering to JSON. Also indicates that the `set` method must be called with `rewrite` set to `true`
|
|
1952
1954
|
to overwrite this value (Axios uses this internally to allow users to opt out of installing certain headers like `User-Agent` or `Content-Type`)
|
|
1953
1955
|
- `undefined` - value is not set
|
|
1954
1956
|
|
|
@@ -1965,7 +1967,7 @@ axios.interceptors.request.use((request: InternalAxiosRequestConfig) => {
|
|
|
1965
1967
|
'My-set-header2': 'my-set-value2',
|
|
1966
1968
|
});
|
|
1967
1969
|
|
|
1968
|
-
request.headers.set('User-Agent', false); //
|
|
1970
|
+
request.headers.set('User-Agent', false); // prevent Axios from setting this header later
|
|
1969
1971
|
|
|
1970
1972
|
request.headers.setContentType('text/plain');
|
|
1971
1973
|
|
|
@@ -2033,7 +2035,7 @@ Constructs a new `AxiosHeaders` instance.
|
|
|
2033
2035
|
constructor(headers?: RawAxiosHeaders | AxiosHeaders | string);
|
|
2034
2036
|
```
|
|
2035
2037
|
|
|
2036
|
-
If the headers object is a string,
|
|
2038
|
+
If the headers object is a string, Axios parses it as raw HTTP headers.
|
|
2037
2039
|
|
|
2038
2040
|
```js
|
|
2039
2041
|
const headers = new AxiosHeaders(`
|
|
@@ -2064,7 +2066,7 @@ The `rewrite` argument controls the overwriting behavior:
|
|
|
2064
2066
|
- `undefined` (default) - overwrite the header unless its value is set to `false`
|
|
2065
2067
|
- `true` - rewrite anyway
|
|
2066
2068
|
|
|
2067
|
-
The option can also accept a user-defined function that determines whether the value
|
|
2069
|
+
The option can also accept a user-defined function that determines whether to overwrite the value.
|
|
2068
2070
|
|
|
2069
2071
|
Returns `this`.
|
|
2070
2072
|
|
|
@@ -2128,7 +2130,7 @@ clear(matcher?: AxiosHeaderMatcher): boolean;
|
|
|
2128
2130
|
```
|
|
2129
2131
|
|
|
2130
2132
|
Removes all headers.
|
|
2131
|
-
Unlike the `delete` method matcher, this optional matcher
|
|
2133
|
+
Unlike the `delete` method matcher, this optional matcher matches the header name rather than the value.
|
|
2132
2134
|
|
|
2133
2135
|
```ts
|
|
2134
2136
|
const headers = new AxiosHeaders({
|
|
@@ -2172,17 +2174,18 @@ Returns `this`.
|
|
|
2172
2174
|
concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
|
|
2173
2175
|
```
|
|
2174
2176
|
|
|
2175
|
-
Merges the instance with targets into a new `AxiosHeaders` instance. If the target is a string,
|
|
2177
|
+
Merges the instance with targets into a new `AxiosHeaders` instance. If the target is a string, Axios parses it as raw HTTP headers.
|
|
2176
2178
|
|
|
2177
2179
|
Returns a new `AxiosHeaders` instance.
|
|
2178
2180
|
|
|
2179
2181
|
### AxiosHeaders#toJSON(asStrings?)
|
|
2180
2182
|
|
|
2181
2183
|
```
|
|
2182
|
-
toJSON(asStrings
|
|
2184
|
+
toJSON(asStrings: true): Record<string, string>;
|
|
2185
|
+
toJSON(asStrings?: false): Record<string, string | string[]>;
|
|
2183
2186
|
```
|
|
2184
2187
|
|
|
2185
|
-
|
|
2188
|
+
Resolves all internal header values into a new null prototype object.
|
|
2186
2189
|
Set `asStrings` to true to resolve arrays as a string containing all elements, separated by commas.
|
|
2187
2190
|
|
|
2188
2191
|
### AxiosHeaders.from(thing?)
|
|
@@ -2192,7 +2195,7 @@ from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders;
|
|
|
2192
2195
|
```
|
|
2193
2196
|
|
|
2194
2197
|
Returns a new `AxiosHeaders` instance created from the raw headers passed in,
|
|
2195
|
-
or
|
|
2198
|
+
or returns the given headers object if it's already an `AxiosHeaders` instance.
|
|
2196
2199
|
|
|
2197
2200
|
### AxiosHeaders.concat(...targets)
|
|
2198
2201
|
|
|
@@ -2216,11 +2219,10 @@ The following shortcuts are available:
|
|
|
2216
2219
|
|
|
2217
2220
|
- `setContentEncoding`, `getContentEncoding`, `hasContentEncoding`
|
|
2218
2221
|
|
|
2219
|
-
##
|
|
2222
|
+
## Fetch adapter
|
|
2220
2223
|
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
To use it by default, it must be selected explicitly:
|
|
2224
|
+
Axios introduced the fetch adapter in `v1.7.0`. By default, Axios uses it when the `xhr` and `http` adapters are not available in the build or not supported by the environment.
|
|
2225
|
+
To use it by default, select it explicitly:
|
|
2224
2226
|
|
|
2225
2227
|
```js
|
|
2226
2228
|
const { data } = axios.get(url, {
|
|
@@ -2238,20 +2240,19 @@ const fetchAxios = axios.create({
|
|
|
2238
2240
|
const { data } = fetchAxios.get(url);
|
|
2239
2241
|
```
|
|
2240
2242
|
|
|
2241
|
-
The adapter supports the same
|
|
2242
|
-
|
|
2243
|
+
The adapter supports the same features as the `xhr` adapter, including upload and download progress capturing.
|
|
2244
|
+
It also supports response types such as `stream` and `formdata` when the environment supports them.
|
|
2243
2245
|
|
|
2244
|
-
###
|
|
2246
|
+
### Custom fetch
|
|
2245
2247
|
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
This
|
|
2248
|
+
Since `v1.12.0`, you can configure the fetch adapter to use a custom fetch API instead of environment globals.
|
|
2249
|
+
Pass a custom `fetch` function, `Request`, and `Response` constructors through `env` config.
|
|
2250
|
+
This helps in custom environments and app frameworks.
|
|
2249
2251
|
|
|
2250
|
-
|
|
2251
|
-
If your custom fetch
|
|
2252
|
-
you must disable their use inside the fetch adapter by passing null.
|
|
2252
|
+
When using a custom fetch, you may also need to set custom `Request` and `Response` constructors. If you do not set them, Axios uses the global objects.
|
|
2253
|
+
If your custom fetch API does not provide these objects and the globals are incompatible with it, pass `null` to disable them inside the fetch adapter.
|
|
2253
2254
|
|
|
2254
|
-
> Note: Setting `Request`
|
|
2255
|
+
> Note: Setting `Request` and `Response` to `null` prevents the fetch adapter from capturing upload and download progress.
|
|
2255
2256
|
|
|
2256
2257
|
Basic example:
|
|
2257
2258
|
|
|
@@ -2271,7 +2272,7 @@ const instance = axios.create({
|
|
|
2271
2272
|
});
|
|
2272
2273
|
```
|
|
2273
2274
|
|
|
2274
|
-
####
|
|
2275
|
+
#### Using with Tauri
|
|
2275
2276
|
|
|
2276
2277
|
A minimal example of setting up Axios for use in a [Tauri](https://tauri.app/plugin/http-client/) app with a platform fetch function that ignores CORS policy for requests.
|
|
2277
2278
|
|
|
@@ -2292,10 +2293,9 @@ const instance = axios.create({
|
|
|
2292
2293
|
const { data } = await instance.get('https://google.com');
|
|
2293
2294
|
```
|
|
2294
2295
|
|
|
2295
|
-
####
|
|
2296
|
+
#### Using with SvelteKit
|
|
2296
2297
|
|
|
2297
|
-
[SvelteKit](https://svelte.dev/docs/kit/web-standards#Fetch-APIs)
|
|
2298
|
-
which makes it incompatible with the standard URL API. So, Axios must be configured to use the custom fetch API:
|
|
2298
|
+
[SvelteKit](https://svelte.dev/docs/kit/web-standards#Fetch-APIs) uses a custom fetch function for server rendering in `load` functions. It also uses relative paths, which are incompatible with the standard URL API. Configure Axios to use SvelteKit's custom fetch API:
|
|
2299
2299
|
|
|
2300
2300
|
```js
|
|
2301
2301
|
export async function load({ fetch }) {
|
|
@@ -2312,13 +2312,13 @@ export async function load({ fetch }) {
|
|
|
2312
2312
|
}
|
|
2313
2313
|
```
|
|
2314
2314
|
|
|
2315
|
-
#### HTTP/2
|
|
2315
|
+
#### HTTP/2 support
|
|
2316
2316
|
|
|
2317
|
-
Axios supports HTTP/2
|
|
2317
|
+
Axios supports HTTP/2 through the Node.js `http` adapter, introduced in v1.13.0.
|
|
2318
2318
|
|
|
2319
|
-
|
|
2319
|
+
Support depends on the runtime environment. Axios relies on Node.js APIs, so HTTP/2 works in supported Node.js versions but may not work in other environments such as Bun or Deno.
|
|
2320
2320
|
|
|
2321
|
-
Options like `httpVersion` and `http2Options` are adapter-specific and may not behave
|
|
2321
|
+
Options like `httpVersion` and `http2Options` are adapter-specific and may not behave the same way in every environment.
|
|
2322
2322
|
|
|
2323
2323
|
Note: HTTP/2 redirects are currently not supported by the HTTP/2 adapter.
|
|
2324
2324
|
|
|
@@ -2340,7 +2340,7 @@ const { data, headers, status } = await axios.post('https://httpbin.org/post', f
|
|
|
2340
2340
|
|
|
2341
2341
|
## Semver
|
|
2342
2342
|
|
|
2343
|
-
|
|
2343
|
+
Axios follows [semver](https://semver.org/) since `v1.0.0`.
|
|
2344
2344
|
|
|
2345
2345
|
## Promises
|
|
2346
2346
|
|
|
@@ -2365,10 +2365,10 @@ try {
|
|
|
2365
2365
|
}
|
|
2366
2366
|
```
|
|
2367
2367
|
|
|
2368
|
-
Because axios
|
|
2369
|
-
The recommended setting is
|
|
2370
|
-
If use ESM, your settings should be fine.
|
|
2371
|
-
If you compile TypeScript to CJS and
|
|
2368
|
+
Because axios publishes an ESM default export and a CJS `module.exports`, TypeScript has a few caveats.
|
|
2369
|
+
The recommended setting is `"moduleResolution": "node16"`, which is implied by `"module": "node16"`. This requires TypeScript 4.7 or greater.
|
|
2370
|
+
If you use ESM, your settings should be fine.
|
|
2371
|
+
If you compile TypeScript to CJS and can't use `"moduleResolution": "node 16"`, enable `esModuleInterop`.
|
|
2372
2372
|
If you use TypeScript to type check CJS JavaScript code, your only option is to use `"moduleResolution": "node16"`.
|
|
2373
2373
|
|
|
2374
2374
|
You can also create a custom instance with typed interceptors:
|
|
@@ -2389,7 +2389,7 @@ apiClient.interceptors.request.use((config: InternalAxiosRequestConfig) => {
|
|
|
2389
2389
|
|
|
2390
2390
|
## Online one-click setup
|
|
2391
2391
|
|
|
2392
|
-
You can use Gitpod,
|
|
2392
|
+
You can use Gitpod, a free online IDE for open source projects, to contribute or run the examples online.
|
|
2393
2393
|
|
|
2394
2394
|
[](https://gitpod.io/#https://github.com/axios/axios/blob/main/examples/server.js)
|
|
2395
2395
|
|
|
@@ -2408,7 +2408,7 @@ npm rebuild husky && npx husky
|
|
|
2408
2408
|
|
|
2409
2409
|
Run those two commands once per fresh checkout. You do **not** need to re-run them after every subsequent `npm install`.
|
|
2410
2410
|
|
|
2411
|
-
Do not remove `ignore-scripts=true` from `.npmrc` to "fix" this
|
|
2411
|
+
Do not remove `ignore-scripts=true` from `.npmrc` to "fix" this. That reopens the lifecycle-script attack surface for every other package in the tree. All CI workflows already invoke npm with `--ignore-scripts`, so local behaviour matches CI.
|
|
2412
2412
|
|
|
2413
2413
|
## Resources
|
|
2414
2414
|
|
|
@@ -2419,7 +2419,7 @@ Do not remove `ignore-scripts=true` from `.npmrc` to "fix" this — that re-open
|
|
|
2419
2419
|
|
|
2420
2420
|
## Credits
|
|
2421
2421
|
|
|
2422
|
-
axios is heavily inspired by the [$http service](https://docs.angularjs.org/api/ng/service/$http)
|
|
2422
|
+
axios is heavily inspired by the [$http service](https://docs.angularjs.org/api/ng/service/$http) in [AngularJS](https://angularjs.org/). It provides a standalone `$http`-like service for use outside AngularJS.
|
|
2423
2423
|
|
|
2424
2424
|
## License
|
|
2425
2425
|
|