当前位置: 首页 > 工具软件 > Jsonnet > 使用案例 >

Axios 发送 json 数据

夏侯旻
2023-12-01
<script src="js/axios-0.18.0.js"></script>
<script>
    var userList = [];
    userList.push({username: "zhangsan", age: 18});
    userList.push({username: "lisi", age: 28});
    console.log(JSON.stringify(userList));
    console.log(typeof JSON.stringify(userList))
    axios({
        method: "post",
        url: "${pageContext.request.contextPath}/user/quick15",
        data: JSON.stringify(userList),
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    }).then(resp => {

    })
</script>
 类似资料: