fetch

作者: xueyueshuai | 来源:发表于2023-08-27 10:49 被阅读0次
            fetch('http://localhost:3000/books', {
                method: 'post',
                body: JSON.stringify({
                    uname: '张三',
                    pwd: '456'
                }),
                headers: {
                    'Content-Type': 'application/json'
                }
            })
                .then((data) =>{
                    return data.json();
                }).then( (res)=> {
                    console.log(res)
                });
    

    相关文章

      网友评论

          本文标题:fetch

          本文链接:https://www.haomeiwen.com/subject/mohgpdtx.html