mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
Merge branch 'master' of github.com:mzabriskie/axios
This commit is contained in:
@@ -140,6 +140,7 @@ For convenience aliases have been provided for all supported request methods.
|
|||||||
##### axios.get(url[, config])
|
##### axios.get(url[, config])
|
||||||
##### axios.delete(url[, config])
|
##### axios.delete(url[, config])
|
||||||
##### axios.head(url[, config])
|
##### axios.head(url[, config])
|
||||||
|
##### axios.options(url[, config])
|
||||||
##### axios.post(url[, data[, config]])
|
##### axios.post(url[, data[, config]])
|
||||||
##### axios.put(url[, data[, config]])
|
##### axios.put(url[, data[, config]])
|
||||||
##### axios.patch(url[, data[, config]])
|
##### axios.patch(url[, data[, config]])
|
||||||
@@ -176,6 +177,7 @@ The available instance methods are listed below. The specified config will be me
|
|||||||
##### axios#get(url[, config])
|
##### axios#get(url[, config])
|
||||||
##### axios#delete(url[, config])
|
##### axios#delete(url[, config])
|
||||||
##### axios#head(url[, config])
|
##### axios#head(url[, config])
|
||||||
|
##### axios#options(url[, config])
|
||||||
##### axios#post(url[, data[, config]])
|
##### axios#post(url[, data[, config]])
|
||||||
##### axios#put(url[, data[, config]])
|
##### axios#put(url[, data[, config]])
|
||||||
##### axios#patch(url[, data[, config]])
|
##### axios#patch(url[, data[, config]])
|
||||||
@@ -308,7 +310,7 @@ These are the available config options for making requests. Only the `url` is re
|
|||||||
proxy: {
|
proxy: {
|
||||||
host: '127.0.0.1',
|
host: '127.0.0.1',
|
||||||
port: 9000,
|
port: 9000,
|
||||||
auth: : {
|
auth: {
|
||||||
username: 'mikeymike',
|
username: 'mikeymike',
|
||||||
password: 'rapunz3l'
|
password: 'rapunz3l'
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -61,7 +61,7 @@ Axios.prototype.request = function request(config) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Provide aliases for supported request methods
|
// Provide aliases for supported request methods
|
||||||
utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
|
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
||||||
/*eslint func-names:0*/
|
/*eslint func-names:0*/
|
||||||
Axios.prototype[method] = function(url, config) {
|
Axios.prototype[method] = function(url, config) {
|
||||||
return this.request(utils.merge(config || {}, {
|
return this.request(utils.merge(config || {}, {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ describe('static api', function () {
|
|||||||
expect(typeof axios.request).toEqual('function');
|
expect(typeof axios.request).toEqual('function');
|
||||||
expect(typeof axios.get).toEqual('function');
|
expect(typeof axios.get).toEqual('function');
|
||||||
expect(typeof axios.head).toEqual('function');
|
expect(typeof axios.head).toEqual('function');
|
||||||
|
expect(typeof axios.options).toEqual('function');
|
||||||
expect(typeof axios.delete).toEqual('function');
|
expect(typeof axios.delete).toEqual('function');
|
||||||
expect(typeof axios.post).toEqual('function');
|
expect(typeof axios.post).toEqual('function');
|
||||||
expect(typeof axios.put).toEqual('function');
|
expect(typeof axios.put).toEqual('function');
|
||||||
@@ -48,6 +49,7 @@ describe('instance api', function () {
|
|||||||
it('should have request methods', function () {
|
it('should have request methods', function () {
|
||||||
expect(typeof instance.request).toEqual('function');
|
expect(typeof instance.request).toEqual('function');
|
||||||
expect(typeof instance.get).toEqual('function');
|
expect(typeof instance.get).toEqual('function');
|
||||||
|
expect(typeof instance.options).toEqual('function');
|
||||||
expect(typeof instance.head).toEqual('function');
|
expect(typeof instance.head).toEqual('function');
|
||||||
expect(typeof instance.delete).toEqual('function');
|
expect(typeof instance.delete).toEqual('function');
|
||||||
expect(typeof instance.post).toEqual('function');
|
expect(typeof instance.post).toEqual('function');
|
||||||
|
|||||||
Reference in New Issue
Block a user