浏览器控制台发送request请求
fetch(new Request('url',{
method:'POST',
headers: {'Content-Type': 'application/json'},
body:"{\"test\":[\"test\"]}"
})).then((resp)=>{console.log(resp)})
需要打印body中的内容:
fetch(new Request('url',{
method:'POST',
headers: {'Content-Type': 'application/json'},
body:"{\"test\":[\"test\"]}"
})).then(res=>res.text()).then(res=>console.log(res))
console.log("talk is cheap, show me you code.")