[英]Hapi JS post request payload parsing issue
I am using HapiJS 11
and now upgrading it to HapiJS 16
. 我正在使用HapiJS 11
,现在将其升级到HapiJS 16
。 While updating I am facing an issue related to payload parsing. 更新时,我面临与有效负载解析相关的问题。
In HapiJS 11
I am getting payload as 在HapiJS 11
我得到的有效载荷为
{
"profile":{
"name": <name>,
"email": <email>
}
}
but in HapiJS 16
I am getting is as 但是在HapiJS 16
我得到的是
{
"profile[name]": <name>,
"profile[email]": <email>
}
I got the solution for the problem. 我找到了解决问题的方法。
Actually from version 13 Hapi JS
has removed parsing query parameters, payload data as a core functionality, to parse these we need to add a plugin hapi-qs with hapi
. 其实从13版Hapi JS
已删除解析查询参数,有效载荷数据作为核心功能,来分析这些问题,我们需要添加一个插件高致病性禽流感-QS与hapi
。
Source: Hapi 13 release summary 来源: Hapi 13发布摘要
Other Sources: 其他来源:
https://github.com/hapijs/hapi/issues/1317 https://github.com/hapijs/hapi/issues/1317
https://github.com/hapijs/discuss/issues/425 https://github.com/hapijs/discuss/issues/425
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.