js axios发起get请求

Posted vwvwvwgwgvervae

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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);
            });

以上是关于js axios发起get请求的主要内容,如果未能解决你的问题,请参考以下文章