latte_web
Version:
22 lines (21 loc) • 479 B
HTML
<html>
<head>
</head>
<body>
<button onClick="test();">测试</button>
<script type="text/javascript" src="./latte_lib.js"></script>
<script type="text/javascript">
function test() {
var req = latte.require("latte_lib").xhr.post("http://192.168.1.104:8080/json");
console.log(req.type.toString());
req.type("text").send(JSON.stringify({
"header": {
"test": "hello"
}
})).end(function(err, data){
console.log(err, data);
});
}
</script>
</body>
</html>