fetch相关

39 阅读1分钟

fetch("dog.ceo/api/breeds/…") .then(res=>{ console.log(res) })

fetch("jsonplaceholder.typicode.com/users",{ method:'POST', body:JSON.stringify({name:1}), headers:{ 'Content-type':"application/json" } }) .then(res=>res.json()) .then(data=>console.log(data))