axios 1.2.0-alpha.1 → 1.2.0
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.
Potentially problematic release.
This version of axios might be problematic. Click here for more details.
- package/CHANGELOG.md +17 -1
- package/README.md +4 -2
- package/dist/axios.js +424 -391
- package/dist/axios.js.map +1 -1
- package/dist/axios.min.js +1 -1
- package/dist/axios.min.js.map +1 -1
- package/dist/browser/axios.cjs +430 -386
- package/dist/browser/axios.cjs.map +1 -1
- package/dist/esm/axios.js +430 -386
- package/dist/esm/axios.js.map +1 -1
- package/dist/esm/axios.min.js +1 -1
- package/dist/esm/axios.min.js.map +1 -1
- package/dist/node/axios.cjs +404 -361
- package/dist/node/axios.cjs.map +1 -1
- package/index.d.ts +5 -1
- package/lib/adapters/adapters.js +59 -0
- package/lib/adapters/http.js +21 -19
- package/lib/adapters/xhr.js +3 -1
- package/lib/core/AxiosError.js +1 -1
- package/lib/core/dispatchRequest.js +2 -1
- package/lib/defaults/index.js +1 -20
- package/lib/env/data.js +1 -1
- package/lib/utils.js +33 -1
- package/package.json +2 -2
- package/lib/adapters/index.js +0 -33
package/CHANGELOG.md
CHANGED
@@ -12,6 +12,12 @@
|
|
12
12
|
- fix: improve AxiosHeaders class [#5224](https://github.com/axios/axios/pull/5224)
|
13
13
|
- fix: TypeScript type definitions for commonjs [#5196](https://github.com/axios/axios/pull/5196)
|
14
14
|
- fix: type definition of use method on AxiosInterceptorManager to match the the README [#5071](https://github.com/axios/axios/pull/5071)
|
15
|
+
- fix: __dirname is not defined in the sandbox [#5269](https://github.com/axios/axios/pull/5269)
|
16
|
+
- fix: AxiosError.toJSON method to avoid circular references [#5247](https://github.com/axios/axios/pull/5247)
|
17
|
+
- fix: Z_BUF_ERROR when content-encoding is set but the response body is empty [#5250](https://github.com/axios/axios/pull/5250)
|
18
|
+
|
19
|
+
### Refactors
|
20
|
+
- refactor: allowing adapters to be loaded by name [#5277](https://github.com/axios/axios/pull/5277)
|
15
21
|
|
16
22
|
### Chores
|
17
23
|
|
@@ -19,15 +25,21 @@
|
|
19
25
|
- chore: update ECOSYSTEM.md [#5077](https://github.com/axios/axios/pull/5077)
|
20
26
|
- chore: update get/index.html [#5116](https://github.com/axios/axios/pull/5116)
|
21
27
|
- chore: update Sandbox UI/UX [#5205](https://github.com/axios/axios/pull/5205)
|
22
|
-
- chore(
|
28
|
+
- chore:(actions): remove git credentials after checkout [#5235](https://github.com/axios/axios/pull/5235)
|
29
|
+
- chore(actions): bump actions/dependency-review-action from 2 to 3 [#5266](https://github.com/axios/axios/pull/5266)
|
30
|
+
- chore(packages): bump loader-utils from 1.4.1 to 1.4.2 [#5295](https://github.com/axios/axios/pull/5295)
|
31
|
+
- chore(packages): bump engine.io from 6.2.0 to 6.2.1 [#5294](https://github.com/axios/axios/pull/5294)
|
32
|
+
- chore(packages): bump socket.io-parser from 4.0.4 to 4.0.5 [#5241](https://github.com/axios/axios/pull/5241)
|
23
33
|
- chore(packages): bump loader-utils from 1.4.0 to 1.4.1 [#5245](https://github.com/axios/axios/pull/5245)
|
24
34
|
- chore(docs): update Resources links in README [#5119](https://github.com/axios/axios/pull/5119)
|
35
|
+
- chore(docs): update the link for JSON url [#5265](https://github.com/axios/axios/pull/5265)
|
25
36
|
- chore(docs): fix broken links [#5218](https://github.com/axios/axios/pull/5218)
|
26
37
|
- chore(docs): update and rename UPGRADE_GUIDE.md to MIGRATION_GUIDE.md [#5170](https://github.com/axios/axios/pull/5170)
|
27
38
|
- chore(docs): typo fix line #856 and #920 [#5194](https://github.com/axios/axios/pull/5194)
|
28
39
|
- chore(docs): typo fix #800 [#5193](https://github.com/axios/axios/pull/5193)
|
29
40
|
- chore(docs): fix typos [#5184](https://github.com/axios/axios/pull/5184)
|
30
41
|
- chore(docs): fix punctuation in README.md [#5197](https://github.com/axios/axios/pull/5197)
|
42
|
+
- chore(docs): update readme in the Handling Errors section - issue reference #5260 [#5261](https://github.com/axios/axios/pull/5261)
|
31
43
|
- chore: remove \b from filename [#5207](https://github.com/axios/axios/pull/5207)
|
32
44
|
- chore(docs): update CHANGELOG.md [#5137](https://github.com/axios/axios/pull/5137)
|
33
45
|
- chore: add sideEffects false to package.json [#5025](https://github.com/axios/axios/pull/5025)
|
@@ -49,6 +61,10 @@
|
|
49
61
|
- [MoPaMo](https://github.com/MoPaMo)
|
50
62
|
- [Daniel Fjeldstad](https://github.com/w3bdesign)
|
51
63
|
- [Adrien Brunet](https://github.com/adrien-may)
|
64
|
+
- [Frazer Smith](https://github.com/Fdawgs)
|
65
|
+
- [HaiTao](https://github.com/836334258)
|
66
|
+
- [AZM](https://github.com/aziyatali)
|
67
|
+
- [relbns](https://github.com/relbns)
|
52
68
|
|
53
69
|
## [1.1.3] - 2022-10-15
|
54
70
|
|
package/README.md
CHANGED
@@ -81,7 +81,7 @@
|
|
81
81
|
- Intercept request and response
|
82
82
|
- Transform request and response data
|
83
83
|
- Cancel requests
|
84
|
-
- Automatic transforms for JSON data
|
84
|
+
- Automatic transforms for [JSON](https://www.json.org/json-en.html) data
|
85
85
|
- 🆕 Automatic data object serialization to `multipart/form-data` and `x-www-form-urlencoded` body encodings
|
86
86
|
- Client side support for protecting against [XSRF](https://en.wikipedia.org/wiki/Cross-site_request_forgery)
|
87
87
|
|
@@ -763,6 +763,8 @@ Read [the interceptor tests](./test/specs/interceptors.spec.js) for seeing all t
|
|
763
763
|
|
764
764
|
## Handling Errors
|
765
765
|
|
766
|
+
the default behavior is to reject every response that returns with a status code that falls out of the range of 2xx and treat it as an error.
|
767
|
+
|
766
768
|
```js
|
767
769
|
axios.get('/user/12345')
|
768
770
|
.catch(function (error) {
|
@@ -785,7 +787,7 @@ axios.get('/user/12345')
|
|
785
787
|
});
|
786
788
|
```
|
787
789
|
|
788
|
-
Using the `validateStatus` config option, you can define HTTP code(s) that should throw an error.
|
790
|
+
Using the `validateStatus` config option, you can override the default condition (status >= 200 && status < 300) and define HTTP code(s) that should throw an error.
|
789
791
|
|
790
792
|
```js
|
791
793
|
axios.get('/user/12345', {
|