js axios发起get请求

js axios发起get请求

axios.get('http://rap2api.taobao.org/app/mock/238720/getMapping',
            {
                params: {
                    userId: "1"
                }
            })
            .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); }); 

js axios发起post请求

axios.post('http://rap2api.taobao.org/app/mock/238720/postMapping',
            {
                params: {
                    userId: "1"
                }
            })
            .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); }); 

猜你喜欢

转载自www.cnblogs.com/vwvwvwgwgvervae/p/12815708.html