📌  相关文章
📜  如何将 json 数据添加到 xmlhttprequest - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:34.202000             🧑  作者: Mango

代码示例1
var xmlhttp = new XMLHttpRequest();   // new HttpRequest instance 
var theUrl = "/json-handler";
xmlhttp.open("POST", theUrl);
xmlhttp.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
xmlhttp.send(JSON.stringify({ "email": "hello@user.com", "response": { "name": "Tester" } }));