gpt4 book ai didi

javascript - 使用字符集 windows-1251 处理请求时出错

转载 作者:行者123 更新时间:2023-12-03 11:45:16 24 4
gpt4 key购买 nike

我有一个用 Node.js Express.js 编写的服务我从另一个在线服务收到 http 请求。这是标题:

{ 
'content-type': 'application/x-www-form-urlencoded; charset=windows-1251',
host: 'swift-language.info:3030',
'content-length': '614',
connection: 'Keep-Alive'
}

body-parser 响应出现 415 错误,并且 Express 未调用我的路线。我猜问题是 charset=windows-1251

最佳答案

您说得对,body-parser 目前不支持非 UTF8 字符集。然而busboy (和 other modules built upon it 例如 connect-busboyexpress-busboy )除了 Node 内置的字符集之外,还支持许多字符集。

关于javascript - 使用字符集 windows-1251 处理请求时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26084373/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com