axios 0.16.1 → 0.18.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 +136 -106
- package/LICENSE +1 -1
- package/README.md +31 -11
- package/UPGRADE_GUIDE.md +3 -3
- package/dist/axios.js +333 -2309
- package/dist/axios.map +1 -1
- package/dist/axios.min.js +5 -5
- package/dist/axios.min.map +1 -1
- package/index.d.ts +20 -14
- package/lib/adapters/http.js +26 -20
- package/lib/adapters/xhr.js +4 -3
- package/lib/core/Axios.js +2 -8
- package/lib/core/createError.js +5 -4
- package/lib/core/dispatchRequest.js +7 -0
- package/lib/core/enhanceError.js +4 -2
- package/lib/core/settle.js +1 -0
- package/lib/defaults.js +4 -0
- package/lib/helpers/buildURL.js +1 -3
- package/lib/helpers/parseHeaders.js +17 -1
- package/lib/utils.js +2 -11
- package/package.json +15 -9
package/CHANGELOG.md
CHANGED
@@ -1,205 +1,235 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
### 0.18.0 (Feb 19, 2018)
|
4
|
+
|
5
|
+
- Adding support for UNIX Sockets when running with Node.js ([#1070](https://github.com/axios/axios/pull/1070))
|
6
|
+
- Fixing typings ([#1177](https://github.com/axios/axios/pull/1177)):
|
7
|
+
- AxiosRequestConfig.proxy: allows type false
|
8
|
+
- AxiosProxyConfig: added auth field
|
9
|
+
- Adding function signature in AxiosInstance interface so AxiosInstance can be invoked ([#1192](https://github.com/axios/axios/pull/1192), [#1254](https://github.com/axios/axios/pull/1254))
|
10
|
+
- Allowing maxContentLength to pass through to redirected calls as maxBodyLength in follow-redirects config ([#1287](https://github.com/axios/axios/pull/1287))
|
11
|
+
- Fixing configuration when using an instance - method can now be set ([#1342](https://github.com/axios/axios/pull/1342))
|
12
|
+
|
13
|
+
|
14
|
+
### 0.17.1 (Nov 11, 2017)
|
15
|
+
|
16
|
+
- Fixing issue with web workers ([#1160](https://github.com/axios/axios/pull/1160))
|
17
|
+
- Allowing overriding transport ([#1080](https://github.com/axios/axios/pull/1080))
|
18
|
+
- Updating TypeScript typings ([#1165](https://github.com/axios/axios/pull/1165), [#1125](https://github.com/axios/axios/pull/1125), [#1131](https://github.com/axios/axios/pull/1131))
|
19
|
+
|
20
|
+
### 0.17.0 (Oct 21, 2017)
|
21
|
+
|
22
|
+
- **BREAKING** Fixing issue with `baseURL` and interceptors ([#950](https://github.com/axios/axios/pull/950))
|
23
|
+
- **BREAKING** Improving handing of duplicate headers ([#874](https://github.com/axios/axios/pull/874))
|
24
|
+
- Adding support for disabling proxies ([#691](https://github.com/axios/axios/pull/691))
|
25
|
+
- Updating TypeScript typings with generic type parameters ([#1061](https://github.com/axios/axios/pull/1061))
|
26
|
+
|
27
|
+
### 0.16.2 (Jun 3, 2017)
|
28
|
+
|
29
|
+
- Fixing issue with including `buffer` in bundle ([#887](https://github.com/axios/axios/pull/887))
|
30
|
+
- Including underlying request in errors ([#830](https://github.com/axios/axios/pull/830))
|
31
|
+
- Convert `method` to lowercase ([#930](https://github.com/axios/axios/pull/930))
|
32
|
+
|
3
33
|
### 0.16.1 (Apr 8, 2017)
|
4
34
|
|
5
|
-
- Improving HTTP adapter to return last request in case of redirects ([#828](https://github.com/
|
6
|
-
- Updating `follow-redirects` dependency ([#829](https://github.com/
|
7
|
-
- Adding support for passing `Buffer` in node ([#773](https://github.com/
|
35
|
+
- Improving HTTP adapter to return last request in case of redirects ([#828](https://github.com/axios/axios/pull/828))
|
36
|
+
- Updating `follow-redirects` dependency ([#829](https://github.com/axios/axios/pull/829))
|
37
|
+
- Adding support for passing `Buffer` in node ([#773](https://github.com/axios/axios/pull/773))
|
8
38
|
|
9
39
|
### 0.16.0 (Mar 31, 2017)
|
10
40
|
|
11
|
-
- **BREAKING** Removing `Promise` from axios typings in favor of built-in type declarations ([#480](https://github.com/
|
12
|
-
- Adding `options` shortcut method ([#461](https://github.com/
|
13
|
-
- Fixing issue with using `responseType: 'json'` in browsers incompatible with XHR Level 2 ([#654](https://github.com/
|
14
|
-
- Improving React Native detection ([#731](https://github.com/
|
15
|
-
- Fixing `combineURLs` to support empty `relativeURL` ([#581](https://github.com/
|
16
|
-
- Removing `PROTECTION_PREFIX` support ([#561](https://github.com/
|
41
|
+
- **BREAKING** Removing `Promise` from axios typings in favor of built-in type declarations ([#480](https://github.com/axios/axios/issues/480))
|
42
|
+
- Adding `options` shortcut method ([#461](https://github.com/axios/axios/pull/461))
|
43
|
+
- Fixing issue with using `responseType: 'json'` in browsers incompatible with XHR Level 2 ([#654](https://github.com/axios/axios/pull/654))
|
44
|
+
- Improving React Native detection ([#731](https://github.com/axios/axios/pull/731))
|
45
|
+
- Fixing `combineURLs` to support empty `relativeURL` ([#581](https://github.com/axios/axios/pull/581))
|
46
|
+
- Removing `PROTECTION_PREFIX` support ([#561](https://github.com/axios/axios/pull/561))
|
17
47
|
|
18
48
|
### 0.15.3 (Nov 27, 2016)
|
19
49
|
|
20
|
-
- Fixing issue with custom instances and global defaults ([#443](https://github.com/
|
21
|
-
- Renaming `axios.d.ts` to `index.d.ts` ([#519](https://github.com/
|
22
|
-
- Adding `get`, `head`, and `delete` to `defaults.headers` ([#509](https://github.com/
|
23
|
-
- Fixing issue with `btoa` and IE ([#507](https://github.com/
|
24
|
-
- Adding support for proxy authentication ([#483](https://github.com/
|
25
|
-
- Improving HTTP adapter to use `http` protocol by default ([#493](https://github.com/
|
26
|
-
- Fixing proxy issues ([#491](https://github.com/
|
50
|
+
- Fixing issue with custom instances and global defaults ([#443](https://github.com/axios/axios/issues/443))
|
51
|
+
- Renaming `axios.d.ts` to `index.d.ts` ([#519](https://github.com/axios/axios/issues/519))
|
52
|
+
- Adding `get`, `head`, and `delete` to `defaults.headers` ([#509](https://github.com/axios/axios/issues/509))
|
53
|
+
- Fixing issue with `btoa` and IE ([#507](https://github.com/axios/axios/issues/507))
|
54
|
+
- Adding support for proxy authentication ([#483](https://github.com/axios/axios/pull/483))
|
55
|
+
- Improving HTTP adapter to use `http` protocol by default ([#493](https://github.com/axios/axios/pull/493))
|
56
|
+
- Fixing proxy issues ([#491](https://github.com/axios/axios/pull/491))
|
27
57
|
|
28
58
|
### 0.15.2 (Oct 17, 2016)
|
29
59
|
|
30
|
-
- Fixing issue with calling `cancel` after response has been received ([#482](https://github.com/
|
60
|
+
- Fixing issue with calling `cancel` after response has been received ([#482](https://github.com/axios/axios/issues/482))
|
31
61
|
|
32
62
|
### 0.15.1 (Oct 14, 2016)
|
33
63
|
|
34
|
-
- Fixing issue with UMD ([#485](https://github.com/
|
64
|
+
- Fixing issue with UMD ([#485](https://github.com/axios/axios/issues/485))
|
35
65
|
|
36
66
|
### 0.15.0 (Oct 10, 2016)
|
37
67
|
|
38
|
-
- Adding cancellation support ([#452](https://github.com/
|
39
|
-
- Moving default adapter to global defaults ([#437](https://github.com/
|
40
|
-
- Fixing issue with `file` URI scheme ([#440](https://github.com/
|
41
|
-
- Fixing issue with `params` objects that have no prototype ([#445](https://github.com/
|
68
|
+
- Adding cancellation support ([#452](https://github.com/axios/axios/pull/452))
|
69
|
+
- Moving default adapter to global defaults ([#437](https://github.com/axios/axios/pull/437))
|
70
|
+
- Fixing issue with `file` URI scheme ([#440](https://github.com/axios/axios/pull/440))
|
71
|
+
- Fixing issue with `params` objects that have no prototype ([#445](https://github.com/axios/axios/pull/445))
|
42
72
|
|
43
73
|
### 0.14.0 (Aug 27, 2016)
|
44
74
|
|
45
|
-
- **BREAKING** Updating TypeScript definitions ([#419](https://github.com/
|
46
|
-
- **BREAKING** Replacing `agent` option with `httpAgent` and `httpsAgent` ([#387](https://github.com/
|
47
|
-
- **BREAKING** Splitting `progress` event handlers into `onUploadProgress` and `onDownloadProgress` ([#423](https://github.com/
|
48
|
-
- Adding support for `http_proxy` and `https_proxy` environment variables ([#366](https://github.com/
|
49
|
-
- Fixing issue with `auth` config option and `Authorization` header ([#397](https://github.com/
|
50
|
-
- Don't set XSRF header if `xsrfCookieName` is `null` ([#406](https://github.com/
|
75
|
+
- **BREAKING** Updating TypeScript definitions ([#419](https://github.com/axios/axios/pull/419))
|
76
|
+
- **BREAKING** Replacing `agent` option with `httpAgent` and `httpsAgent` ([#387](https://github.com/axios/axios/pull/387))
|
77
|
+
- **BREAKING** Splitting `progress` event handlers into `onUploadProgress` and `onDownloadProgress` ([#423](https://github.com/axios/axios/pull/423))
|
78
|
+
- Adding support for `http_proxy` and `https_proxy` environment variables ([#366](https://github.com/axios/axios/pull/366))
|
79
|
+
- Fixing issue with `auth` config option and `Authorization` header ([#397](https://github.com/axios/axios/pull/397))
|
80
|
+
- Don't set XSRF header if `xsrfCookieName` is `null` ([#406](https://github.com/axios/axios/pull/406))
|
51
81
|
|
52
82
|
### 0.13.1 (Jul 16, 2016)
|
53
83
|
|
54
|
-
- Fixing issue with response data not being transformed on error ([#378](https://github.com/
|
84
|
+
- Fixing issue with response data not being transformed on error ([#378](https://github.com/axios/axios/issues/378))
|
55
85
|
|
56
86
|
### 0.13.0 (Jul 13, 2016)
|
57
87
|
|
58
|
-
- **BREAKING** Improved error handling ([#345](https://github.com/
|
59
|
-
- **BREAKING** Response transformer now invoked in dispatcher not adapter ([10eb238](https://github.com/
|
60
|
-
- **BREAKING** Request adapters now return a `Promise` ([157efd5](https://github.com/
|
61
|
-
- Fixing issue with `withCredentials` not being overwritten ([#343](https://github.com/
|
62
|
-
- Fixing regression with request transformer being called before request interceptor ([#352](https://github.com/
|
63
|
-
- Fixing custom instance defaults ([#341](https://github.com/
|
64
|
-
- Fixing instances created from `axios.create` to have same API as default axios ([#217](https://github.com/
|
88
|
+
- **BREAKING** Improved error handling ([#345](https://github.com/axios/axios/pull/345))
|
89
|
+
- **BREAKING** Response transformer now invoked in dispatcher not adapter ([10eb238](https://github.com/axios/axios/commit/10eb23865101f9347570552c04e9d6211376e25e))
|
90
|
+
- **BREAKING** Request adapters now return a `Promise` ([157efd5](https://github.com/axios/axios/commit/157efd5615890301824e3121cc6c9d2f9b21f94a))
|
91
|
+
- Fixing issue with `withCredentials` not being overwritten ([#343](https://github.com/axios/axios/issues/343))
|
92
|
+
- Fixing regression with request transformer being called before request interceptor ([#352](https://github.com/axios/axios/issues/352))
|
93
|
+
- Fixing custom instance defaults ([#341](https://github.com/axios/axios/issues/341))
|
94
|
+
- Fixing instances created from `axios.create` to have same API as default axios ([#217](https://github.com/axios/axios/issues/217))
|
65
95
|
|
66
96
|
### 0.12.0 (May 31, 2016)
|
67
97
|
|
68
|
-
- Adding support for `URLSearchParams` ([#317](https://github.com/
|
69
|
-
- Adding `maxRedirects` option ([#307](https://github.com/
|
98
|
+
- Adding support for `URLSearchParams` ([#317](https://github.com/axios/axios/pull/317))
|
99
|
+
- Adding `maxRedirects` option ([#307](https://github.com/axios/axios/pull/307))
|
70
100
|
|
71
101
|
### 0.11.1 (May 17, 2016)
|
72
102
|
|
73
|
-
- Fixing IE CORS support ([#313](https://github.com/
|
74
|
-
- Fixing detection of `FormData` ([#325](https://github.com/
|
75
|
-
- Adding `Axios` class to exports ([#321](https://github.com/
|
103
|
+
- Fixing IE CORS support ([#313](https://github.com/axios/axios/pull/313))
|
104
|
+
- Fixing detection of `FormData` ([#325](https://github.com/axios/axios/pull/325))
|
105
|
+
- Adding `Axios` class to exports ([#321](https://github.com/axios/axios/pull/321))
|
76
106
|
|
77
107
|
### 0.11.0 (Apr 26, 2016)
|
78
108
|
|
79
|
-
- Adding support for Stream with HTTP adapter ([#296](https://github.com/
|
80
|
-
- Adding support for custom HTTP status code error ranges ([#308](https://github.com/
|
81
|
-
- Fixing issue with ArrayBuffer ([#299](https://github.com/
|
109
|
+
- Adding support for Stream with HTTP adapter ([#296](https://github.com/axios/axios/pull/296))
|
110
|
+
- Adding support for custom HTTP status code error ranges ([#308](https://github.com/axios/axios/pull/308))
|
111
|
+
- Fixing issue with ArrayBuffer ([#299](https://github.com/axios/axios/pull/299))
|
82
112
|
|
83
113
|
### 0.10.0 (Apr 20, 2016)
|
84
114
|
|
85
|
-
- Fixing issue with some requests sending `undefined` instead of `null` ([#250](https://github.com/
|
86
|
-
- Fixing basic auth for HTTP adapter ([#252](https://github.com/
|
87
|
-
- Fixing request timeout for XHR adapter ([#227](https://github.com/
|
88
|
-
- Fixing IE8 support by using `onreadystatechange` instead of `onload` ([#249](https://github.com/
|
89
|
-
- Fixing IE9 cross domain requests ([#251](https://github.com/
|
90
|
-
- Adding `maxContentLength` option ([#275](https://github.com/
|
91
|
-
- Fixing XHR support for WebWorker environment ([#279](https://github.com/
|
92
|
-
- Adding request instance to response ([#200](https://github.com/
|
115
|
+
- Fixing issue with some requests sending `undefined` instead of `null` ([#250](https://github.com/axios/axios/pull/250))
|
116
|
+
- Fixing basic auth for HTTP adapter ([#252](https://github.com/axios/axios/pull/252))
|
117
|
+
- Fixing request timeout for XHR adapter ([#227](https://github.com/axios/axios/pull/227))
|
118
|
+
- Fixing IE8 support by using `onreadystatechange` instead of `onload` ([#249](https://github.com/axios/axios/pull/249))
|
119
|
+
- Fixing IE9 cross domain requests ([#251](https://github.com/axios/axios/pull/251))
|
120
|
+
- Adding `maxContentLength` option ([#275](https://github.com/axios/axios/pull/275))
|
121
|
+
- Fixing XHR support for WebWorker environment ([#279](https://github.com/axios/axios/pull/279))
|
122
|
+
- Adding request instance to response ([#200](https://github.com/axios/axios/pull/200))
|
93
123
|
|
94
124
|
### 0.9.1 (Jan 24, 2016)
|
95
125
|
|
96
|
-
- Improving handling of request timeout in node ([#124](https://github.com/
|
97
|
-
- Fixing network errors not rejecting ([#205](https://github.com/
|
98
|
-
- Fixing issue with IE rejecting on HTTP 204 ([#201](https://github.com/
|
99
|
-
- Fixing host/port when following redirects ([#198](https://github.com/
|
126
|
+
- Improving handling of request timeout in node ([#124](https://github.com/axios/axios/issues/124))
|
127
|
+
- Fixing network errors not rejecting ([#205](https://github.com/axios/axios/pull/205))
|
128
|
+
- Fixing issue with IE rejecting on HTTP 204 ([#201](https://github.com/axios/axios/issues/201))
|
129
|
+
- Fixing host/port when following redirects ([#198](https://github.com/axios/axios/pull/198))
|
100
130
|
|
101
131
|
### 0.9.0 (Jan 18, 2016)
|
102
132
|
|
103
133
|
- Adding support for custom adapters
|
104
|
-
- Fixing Content-Type header being removed when data is false ([#195](https://github.com/
|
105
|
-
- Improving XDomainRequest implementation ([#185](https://github.com/
|
106
|
-
- Improving config merging and order of precedence ([#183](https://github.com/
|
107
|
-
- Fixing XDomainRequest support for only <= IE9 ([#182](https://github.com/
|
134
|
+
- Fixing Content-Type header being removed when data is false ([#195](https://github.com/axios/axios/pull/195))
|
135
|
+
- Improving XDomainRequest implementation ([#185](https://github.com/axios/axios/pull/185))
|
136
|
+
- Improving config merging and order of precedence ([#183](https://github.com/axios/axios/pull/183))
|
137
|
+
- Fixing XDomainRequest support for only <= IE9 ([#182](https://github.com/axios/axios/pull/182))
|
108
138
|
|
109
139
|
### 0.8.1 (Dec 14, 2015)
|
110
140
|
|
111
|
-
- Adding support for passing XSRF token for cross domain requests when using `withCredentials` ([#168](https://github.com/
|
112
|
-
- Fixing error with format of basic auth header ([#178](https://github.com/
|
113
|
-
- Fixing error with JSON payloads throwing `InvalidStateError` in some cases ([#174](https://github.com/
|
141
|
+
- Adding support for passing XSRF token for cross domain requests when using `withCredentials` ([#168](https://github.com/axios/axios/pull/168))
|
142
|
+
- Fixing error with format of basic auth header ([#178](https://github.com/axios/axios/pull/173))
|
143
|
+
- Fixing error with JSON payloads throwing `InvalidStateError` in some cases ([#174](https://github.com/axios/axios/pull/174))
|
114
144
|
|
115
145
|
### 0.8.0 (Dec 11, 2015)
|
116
146
|
|
117
|
-
- Adding support for creating instances of axios ([#123](https://github.com/
|
118
|
-
- Fixing http adapter to use `Buffer` instead of `String` in case of `responseType === 'arraybuffer'` ([#128](https://github.com/
|
119
|
-
- Adding support for using custom parameter serializer with `paramsSerializer` option ([#121](https://github.com/
|
120
|
-
- Fixing issue in IE8 caused by `forEach` on `arguments` ([#127](https://github.com/
|
121
|
-
- Adding support for following redirects in node ([#146](https://github.com/
|
122
|
-
- Adding support for transparent decompression if `content-encoding` is set ([#149](https://github.com/
|
123
|
-
- Adding support for transparent XDomainRequest to handle cross domain requests in IE9 ([#140](https://github.com/
|
124
|
-
- Adding support for HTTP basic auth via Authorization header ([#167](https://github.com/
|
125
|
-
- Adding support for baseURL option ([#160](https://github.com/
|
147
|
+
- Adding support for creating instances of axios ([#123](https://github.com/axios/axios/pull/123))
|
148
|
+
- Fixing http adapter to use `Buffer` instead of `String` in case of `responseType === 'arraybuffer'` ([#128](https://github.com/axios/axios/pull/128))
|
149
|
+
- Adding support for using custom parameter serializer with `paramsSerializer` option ([#121](https://github.com/axios/axios/pull/121))
|
150
|
+
- Fixing issue in IE8 caused by `forEach` on `arguments` ([#127](https://github.com/axios/axios/pull/127))
|
151
|
+
- Adding support for following redirects in node ([#146](https://github.com/axios/axios/pull/146))
|
152
|
+
- Adding support for transparent decompression if `content-encoding` is set ([#149](https://github.com/axios/axios/pull/149))
|
153
|
+
- Adding support for transparent XDomainRequest to handle cross domain requests in IE9 ([#140](https://github.com/axios/axios/pull/140))
|
154
|
+
- Adding support for HTTP basic auth via Authorization header ([#167](https://github.com/axios/axios/pull/167))
|
155
|
+
- Adding support for baseURL option ([#160](https://github.com/axios/axios/pull/160))
|
126
156
|
|
127
157
|
### 0.7.0 (Sep 29, 2015)
|
128
158
|
|
129
|
-
- Fixing issue with minified bundle in IE8 ([#87](https://github.com/
|
130
|
-
- Adding support for passing agent in node ([#102](https://github.com/
|
131
|
-
- Adding support for returning result from `axios.spread` for chaining ([#106](https://github.com/
|
132
|
-
- Fixing typescript definition ([#105](https://github.com/
|
133
|
-
- Fixing default timeout config for node ([#112](https://github.com/
|
134
|
-
- Adding support for use in web workers, and react-native ([#70](https://github.com/
|
135
|
-
- Adding support for fetch like API `axios(url[, config])` ([#116](https://github.com/
|
159
|
+
- Fixing issue with minified bundle in IE8 ([#87](https://github.com/axios/axios/pull/87))
|
160
|
+
- Adding support for passing agent in node ([#102](https://github.com/axios/axios/pull/102))
|
161
|
+
- Adding support for returning result from `axios.spread` for chaining ([#106](https://github.com/axios/axios/pull/106))
|
162
|
+
- Fixing typescript definition ([#105](https://github.com/axios/axios/pull/105))
|
163
|
+
- Fixing default timeout config for node ([#112](https://github.com/axios/axios/pull/112))
|
164
|
+
- Adding support for use in web workers, and react-native ([#70](https://github.com/axios/axios/issue/70)), ([#98](https://github.com/axios/axios/pull/98))
|
165
|
+
- Adding support for fetch like API `axios(url[, config])` ([#116](https://github.com/axios/axios/issues/116))
|
136
166
|
|
137
167
|
### 0.6.0 (Sep 21, 2015)
|
138
168
|
|
139
169
|
- Removing deprecated success/error aliases
|
140
|
-
- Fixing issue with array params not being properly encoded ([#49](https://github.com/
|
141
|
-
- Fixing issue with User-Agent getting overridden ([#69](https://github.com/
|
142
|
-
- Adding support for timeout config ([#56](https://github.com/
|
170
|
+
- Fixing issue with array params not being properly encoded ([#49](https://github.com/axios/axios/pull/49))
|
171
|
+
- Fixing issue with User-Agent getting overridden ([#69](https://github.com/axios/axios/issues/69))
|
172
|
+
- Adding support for timeout config ([#56](https://github.com/axios/axios/issues/56))
|
143
173
|
- Removing es6-promise dependency
|
144
|
-
- Fixing issue preventing `length` to be used as a parameter ([#91](https://github.com/
|
145
|
-
- Fixing issue with IE8 ([#85](https://github.com/
|
174
|
+
- Fixing issue preventing `length` to be used as a parameter ([#91](https://github.com/axios/axios/pull/91))
|
175
|
+
- Fixing issue with IE8 ([#85](https://github.com/axios/axios/pull/85))
|
146
176
|
- Converting build to UMD
|
147
177
|
|
148
178
|
### 0.5.4 (Apr 08, 2015)
|
149
179
|
|
150
|
-
- Fixing issue with FormData not being sent ([#53](https://github.com/
|
180
|
+
- Fixing issue with FormData not being sent ([#53](https://github.com/axios/axios/issues/53))
|
151
181
|
|
152
182
|
### 0.5.3 (Apr 07, 2015)
|
153
183
|
|
154
|
-
- Using JSON.parse unconditionally when transforming response string ([#55](https://github.com/
|
184
|
+
- Using JSON.parse unconditionally when transforming response string ([#55](https://github.com/axios/axios/issues/55))
|
155
185
|
|
156
186
|
### 0.5.2 (Mar 13, 2015)
|
157
187
|
|
158
|
-
- Adding support for `statusText` in response ([#46](https://github.com/
|
188
|
+
- Adding support for `statusText` in response ([#46](https://github.com/axios/axios/issues/46))
|
159
189
|
|
160
190
|
### 0.5.1 (Mar 10, 2015)
|
161
191
|
|
162
|
-
- Fixing issue using strict mode ([#45](https://github.com/
|
163
|
-
- Fixing issue with standalone build ([#47](https://github.com/
|
192
|
+
- Fixing issue using strict mode ([#45](https://github.com/axios/axios/issues/45))
|
193
|
+
- Fixing issue with standalone build ([#47](https://github.com/axios/axios/issues/47))
|
164
194
|
|
165
195
|
### 0.5.0 (Jan 23, 2015)
|
166
196
|
|
167
|
-
- Adding support for intercepetors ([#14](https://github.com/
|
197
|
+
- Adding support for intercepetors ([#14](https://github.com/axios/axios/issues/14))
|
168
198
|
- Updating es6-promise dependency
|
169
199
|
|
170
200
|
### 0.4.2 (Dec 10, 2014)
|
171
201
|
|
172
|
-
- Fixing issue with `Content-Type` when using `FormData` ([#22](https://github.com/
|
173
|
-
- Adding support for TypeScript ([#25](https://github.com/
|
174
|
-
- Fixing issue with standalone build ([#29](https://github.com/
|
175
|
-
- Fixing issue with verbs needing to be capitalized in some browsers ([#30](https://github.com/
|
202
|
+
- Fixing issue with `Content-Type` when using `FormData` ([#22](https://github.com/axios/axios/issues/22))
|
203
|
+
- Adding support for TypeScript ([#25](https://github.com/axios/axios/issues/25))
|
204
|
+
- Fixing issue with standalone build ([#29](https://github.com/axios/axios/issues/29))
|
205
|
+
- Fixing issue with verbs needing to be capitalized in some browsers ([#30](https://github.com/axios/axios/issues/30))
|
176
206
|
|
177
207
|
### 0.4.1 (Oct 15, 2014)
|
178
208
|
|
179
|
-
- Adding error handling to request for node.js ([#18](https://github.com/
|
209
|
+
- Adding error handling to request for node.js ([#18](https://github.com/axios/axios/issues/18))
|
180
210
|
|
181
211
|
### 0.4.0 (Oct 03, 2014)
|
182
212
|
|
183
|
-
- Adding support for `ArrayBuffer` and `ArrayBufferView` ([#10](https://github.com/
|
184
|
-
- Adding support for utf-8 for node.js ([#13](https://github.com/
|
185
|
-
- Adding support for SSL for node.js ([#12](https://github.com/
|
186
|
-
- Fixing incorrect `Content-Type` header ([#9](https://github.com/
|
187
|
-
- Adding standalone build without bundled es6-promise ([#11](https://github.com/
|
213
|
+
- Adding support for `ArrayBuffer` and `ArrayBufferView` ([#10](https://github.com/axios/axios/issues/10))
|
214
|
+
- Adding support for utf-8 for node.js ([#13](https://github.com/axios/axios/issues/13))
|
215
|
+
- Adding support for SSL for node.js ([#12](https://github.com/axios/axios/issues/12))
|
216
|
+
- Fixing incorrect `Content-Type` header ([#9](https://github.com/axios/axios/issues/9))
|
217
|
+
- Adding standalone build without bundled es6-promise ([#11](https://github.com/axios/axios/issues/11))
|
188
218
|
- Deprecating `success`/`error` in favor of `then`/`catch`
|
189
219
|
|
190
220
|
### 0.3.1 (Sep 16, 2014)
|
191
221
|
|
192
|
-
- Fixing missing post body when using node.js ([#3](https://github.com/
|
222
|
+
- Fixing missing post body when using node.js ([#3](https://github.com/axios/axios/issues/3))
|
193
223
|
|
194
224
|
### 0.3.0 (Sep 16, 2014)
|
195
225
|
|
196
|
-
- Fixing `success` and `error` to properly receive response data as individual arguments ([#8](https://github.com/
|
197
|
-
- Updating `then` and `catch` to receive response data as a single object ([#6](https://github.com/
|
198
|
-
- Fixing issue with `all` not working ([#7](https://github.com/
|
226
|
+
- Fixing `success` and `error` to properly receive response data as individual arguments ([#8](https://github.com/axios/axios/issues/8))
|
227
|
+
- Updating `then` and `catch` to receive response data as a single object ([#6](https://github.com/axios/axios/issues/6))
|
228
|
+
- Fixing issue with `all` not working ([#7](https://github.com/axios/axios/issues/7))
|
199
229
|
|
200
230
|
### 0.2.2 (Sep 14, 2014)
|
201
231
|
|
202
|
-
- Fixing bundling with browserify ([#4](https://github.com/
|
232
|
+
- Fixing bundling with browserify ([#4](https://github.com/axios/axios/issues/4))
|
203
233
|
|
204
234
|
### 0.2.1 (Sep 12, 2014)
|
205
235
|
|
@@ -208,7 +238,7 @@
|
|
208
238
|
### 0.2.0 (Sep 12, 2014)
|
209
239
|
|
210
240
|
- Adding support for `all` and `spread`
|
211
|
-
- Adding support for node.js ([#1](https://github.com/
|
241
|
+
- Adding support for node.js ([#1](https://github.com/axios/axios/issues/1))
|
212
242
|
|
213
243
|
### 0.1.0 (Aug 29, 2014)
|
214
244
|
|
package/LICENSE
CHANGED
package/README.md
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
# axios
|
2
2
|
|
3
3
|
[](https://www.npmjs.org/package/axios)
|
4
|
-
[](https://travis-ci.org/axios/axios)
|
5
5
|
[](https://coveralls.io/r/mzabriskie/axios)
|
6
6
|
[](http://npm-stat.com/charts.html?package=axios)
|
7
7
|
[](https://gitter.im/mzabriskie/axios)
|
8
|
+
[](https://www.codetriage.com/axios/axios)
|
8
9
|
|
9
10
|
Promise based HTTP client for the browser and node.js
|
10
11
|
|
@@ -215,7 +216,8 @@ These are the available config options for making requests. Only the `url` is re
|
|
215
216
|
// This is only applicable for request methods 'PUT', 'POST', and 'PATCH'
|
216
217
|
// The last function in the array must return a string or an instance of Buffer, ArrayBuffer,
|
217
218
|
// FormData or Stream
|
218
|
-
|
219
|
+
// You may modify the headers object.
|
220
|
+
transformRequest: [function (data, headers) {
|
219
221
|
// Do whatever you want to transform the data
|
220
222
|
|
221
223
|
return data;
|
@@ -311,6 +313,12 @@ These are the available config options for making requests. Only the `url` is re
|
|
311
313
|
// If set to 0, no redirects will be followed.
|
312
314
|
maxRedirects: 5, // default
|
313
315
|
|
316
|
+
// `socketPath` defines a UNIX Socket to be used in node.js.
|
317
|
+
// e.g. '/var/run/docker.sock' to send requests to the docker daemon.
|
318
|
+
// Only either `socketPath` or `proxy` can be specified.
|
319
|
+
// If both are specified, `socketPath` is used.
|
320
|
+
socketPath: null, // default
|
321
|
+
|
314
322
|
// `httpAgent` and `httpsAgent` define a custom agent to be used when performing http
|
315
323
|
// and https requests, respectively, in node.js. This allows options to be added like
|
316
324
|
// `keepAlive` that are not enabled by default.
|
@@ -318,6 +326,7 @@ These are the available config options for making requests. Only the `url` is re
|
|
318
326
|
httpsAgent: new https.Agent({ keepAlive: true }),
|
319
327
|
|
320
328
|
// 'proxy' defines the hostname and port of the proxy server
|
329
|
+
// Use `false` to disable proxies, ignoring environment variables.
|
321
330
|
// `auth` indicates that HTTP Basic auth should be used to connect to the proxy, and
|
322
331
|
// supplies credentials.
|
323
332
|
// This will set an `Proxy-Authorization` header, overwriting any existing
|
@@ -408,7 +417,7 @@ instance.defaults.headers.common['Authorization'] = AUTH_TOKEN;
|
|
408
417
|
|
409
418
|
### Config order of precedence
|
410
419
|
|
411
|
-
Config will be merged with an order of precedence. The order is library defaults found in
|
420
|
+
Config will be merged with an order of precedence. The order is library defaults found in [lib/defaults.js](https://github.com/axios/axios/blob/master/lib/defaults.js#L28), then `defaults` property of the instance, and finally `config` argument for the request. The latter will take precedence over the former. Here's an example.
|
412
421
|
|
413
422
|
```js
|
414
423
|
// Create an instance using the config defaults provided by the library
|
@@ -469,11 +478,16 @@ instance.interceptors.request.use(function () {/*...*/});
|
|
469
478
|
axios.get('/user/12345')
|
470
479
|
.catch(function (error) {
|
471
480
|
if (error.response) {
|
472
|
-
// The request was made
|
481
|
+
// The request was made and the server responded with a status code
|
473
482
|
// that falls out of the range of 2xx
|
474
483
|
console.log(error.response.data);
|
475
484
|
console.log(error.response.status);
|
476
485
|
console.log(error.response.headers);
|
486
|
+
} else if (error.request) {
|
487
|
+
// The request was made but no response was received
|
488
|
+
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of
|
489
|
+
// http.ClientRequest in node.js
|
490
|
+
console.log(error.request);
|
477
491
|
} else {
|
478
492
|
// Something happened in setting up the request that triggered an Error
|
479
493
|
console.log('Error', error.message);
|
@@ -514,6 +528,12 @@ axios.get('/user/12345', {
|
|
514
528
|
}
|
515
529
|
});
|
516
530
|
|
531
|
+
axios.post('/user/12345', {
|
532
|
+
name: 'new name'
|
533
|
+
}, {
|
534
|
+
cancelToken: source.token
|
535
|
+
})
|
536
|
+
|
517
537
|
// cancel the request (the message parameter is optional)
|
518
538
|
source.cancel('Operation canceled by the user.');
|
519
539
|
```
|
@@ -552,7 +572,7 @@ params.append('param2', 'value2');
|
|
552
572
|
axios.post('/foo', params);
|
553
573
|
```
|
554
574
|
|
555
|
-
> Note that `URLSearchParams` is not supported by all browsers, but there is a [polyfill](https://github.com/WebReflection/url-search-params) available (make sure to polyfill the global environment).
|
575
|
+
> Note that `URLSearchParams` is not supported by all browsers (see [caniuse.com](http://www.caniuse.com/#feat=urlsearchparams)), but there is a [polyfill](https://github.com/WebReflection/url-search-params) available (make sure to polyfill the global environment).
|
556
576
|
|
557
577
|
Alternatively, you can encode data using the [`qs`](https://github.com/ljharb/qs) library:
|
558
578
|
|
@@ -570,7 +590,7 @@ var querystring = require('querystring');
|
|
570
590
|
axios.post('http://something.com/', querystring.stringify({ foo: 'bar' }));
|
571
591
|
```
|
572
592
|
|
573
|
-
You can also use the `qs` library.
|
593
|
+
You can also use the [`qs`](https://github.com/ljharb/qs) library.
|
574
594
|
|
575
595
|
## Semver
|
576
596
|
|
@@ -590,11 +610,11 @@ axios.get('/user?ID=12345');
|
|
590
610
|
|
591
611
|
## Resources
|
592
612
|
|
593
|
-
* [Changelog](https://github.com/
|
594
|
-
* [Upgrade Guide](https://github.com/
|
595
|
-
* [Ecosystem](https://github.com/
|
596
|
-
* [Contributing Guide](https://github.com/
|
597
|
-
* [Code of Conduct](https://github.com/
|
613
|
+
* [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
|
614
|
+
* [Upgrade Guide](https://github.com/axios/axios/blob/master/UPGRADE_GUIDE.md)
|
615
|
+
* [Ecosystem](https://github.com/axios/axios/blob/master/ECOSYSTEM.md)
|
616
|
+
* [Contributing Guide](https://github.com/axios/axios/blob/master/CONTRIBUTING.md)
|
617
|
+
* [Code of Conduct](https://github.com/axios/axios/blob/master/CODE_OF_CONDUCT.md)
|
598
618
|
|
599
619
|
## Credits
|
600
620
|
|
package/UPGRADE_GUIDE.md
CHANGED
@@ -115,8 +115,8 @@ function myAdapter(config) {
|
|
115
115
|
```
|
116
116
|
|
117
117
|
See the related commits for more details:
|
118
|
-
- [Response transformers](https://github.com/
|
119
|
-
- [Request adapter Promise](https://github.com/
|
118
|
+
- [Response transformers](https://github.com/axios/axios/commit/10eb23865101f9347570552c04e9d6211376e25e)
|
119
|
+
- [Request adapter Promise](https://github.com/axios/axios/commit/157efd5615890301824e3121cc6c9d2f9b21f94a)
|
120
120
|
|
121
121
|
### 0.5.x -> 0.6.0
|
122
122
|
|
@@ -135,7 +135,7 @@ This will polyfill the global environment, and only needs to be done once.
|
|
135
135
|
|
136
136
|
#### `axios.success`/`axios.error`
|
137
137
|
|
138
|
-
The `success`, and `error` aliases were deprectated in [0.4.0](https://github.com/
|
138
|
+
The `success`, and `error` aliases were deprectated in [0.4.0](https://github.com/axios/axios/blob/master/CHANGELOG.md#040-oct-03-2014). As of this release they have been removed entirely. Instead please use `axios.then`, and `axios.catch` respectively.
|
139
139
|
|
140
140
|
```js
|
141
141
|
axios.get('some/url')
|