提交 3579da4c 编写于 作者: N Nick Uraltsev 提交者: GitHub

Merge pull request #930 from luciy/master

Convert the method parameter to lowercase
......@@ -35,6 +35,7 @@ Axios.prototype.request = function request(config) {
}
config = utils.merge(defaults, this.defaults, { method: 'get' }, config);
config.method = config.method.toLowerCase();
// Support baseURL config
if (config.baseURL && !isAbsoluteURL(config.url)) {
......
......@@ -17,6 +17,22 @@ describe('requests', function () {
});
});
it('should treat method value as lowercase string', function (done) {
axios({
url: '/foo',
method: 'POST'
}).then(function (response) {
expect(response.config.method).toBe('post');
done();
});
getAjaxRequest().then(function (request) {
request.respondWith({
status: 200
});
});
});
it('should allow string arg as url, and config arg', function (done) {
axios.post('/foo');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册