Nodejs中http响应头 设置中文格式不乱码
const http = require("http");
const app = http.createServer((req, res) => {
// node 响应头返回中文
res.setHeader("Content-Type", "text/html;charset=utf8");
});
app.listen(8000, () => { console.log("8000开启成功") })
Nodejs中http响应头 设置中文格式不乱码
const http = require("http");
const app = http.createServer((req, res) => {
// node 响应头返回中文
res.setHeader("Content-Type", "text/html;charset=utf8");
});
app.listen(8000, () => { console.log("8000开启成功") })