vue.js axios call api example


代码样例:

vue.js axios call api example

 

 

 code:

vue.js axios call api example
let url = '/api/xxx/yyy';
            let paramObj = JSON.stringify(
                {
                }
            );
            axios
                .post(url,
                    paramObj,
                    {
                        headers: {
                            'Content-Type': 'application/json; charset=utf-8'
                        }
                    })
                .then(response => {
                    if (response.data.ResponseStatus) {
                        //do success coding...
                    }
                    else {
                        //do fail coding...
                    }
                })
                .catch(error => {
                    console.log(error)
                })
                .finally(() => {
                    //do something...
                })
Source Code

 

上一篇:阶段1 语言基础+高级_1-3-Java语言高级_06-File类与IO流_4字符输出流的基本使用_写出单个字符


下一篇:python11