通过设置 response 的 Content-type 来解决
response
Content-type
import type { IncomingMessage, ServerResponse } from 'http' (req: IncomingMessage, res: ServerResponse) => { // 省略 ... res.setHeader('Content-type', 'application/json;charset=utf-8') // 省略 ... }