Hapi JS post 请求负载解析问题
Hapi JS post request payload parsing issue
我正在使用 HapiJS 11
,现在升级到 HapiJS 16
。更新时我遇到了与有效负载解析相关的问题。
在 HapiJS 11
中,我得到的有效负载为
{
"profile":{
"name": <name>,
"email": <email>
}
}
但在 HapiJS 16
我得到的是
{
"profile[name]": <name>,
"profile[email]": <email>
}
我得到了问题的解决方案。
实际上从版本 13 Hapi JS
中删除了解析查询参数、有效负载数据作为核心功能,要解析这些我们需要添加一个插件 hapi-qs 和 hapi
。
其他来源:
我正在使用 HapiJS 11
,现在升级到 HapiJS 16
。更新时我遇到了与有效负载解析相关的问题。
在 HapiJS 11
中,我得到的有效负载为
{
"profile":{
"name": <name>,
"email": <email>
}
}
但在 HapiJS 16
我得到的是
{
"profile[name]": <name>,
"profile[email]": <email>
}
我得到了问题的解决方案。
实际上从版本 13 Hapi JS
中删除了解析查询参数、有效负载数据作为核心功能,要解析这些我们需要添加一个插件 hapi-qs 和 hapi
。
其他来源: