Fetch请求示例:
const url = "http://example.com/"; const options = { method: "POST", headers: { Accept: "application/json", "Content-Type": "application/json;charset=UTF-8", }, body: JSON.stringify({ a: 10, b: 20, }), }; fetch(url, options).then((response) => { console.log(response.status); });
标签:const,response,application,json,XMLHttpRequest,Post,Fetch From: https://www.cnblogs.com/friend/p/17177909.html