Dau
Dau

Reputation: 8858

Hapi JS post request payload parsing issue

I am using HapiJS 11 and now upgrading it to HapiJS 16. While updating I am facing an issue related to payload parsing.

In HapiJS 11 I am getting payload as

{
 "profile":{
   "name": <name>,
   "email": <email>
 }
}

but in HapiJS 16 I am getting is as

{
 "profile[name]": <name>,
 "profile[email]": <email>
}

Upvotes: 0

Views: 807

Answers (1)

Dau
Dau

Reputation: 8858

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.

Source: Hapi 13 release summary

Other Sources:

https://github.com/hapijs/hapi/issues/1317

https://github.com/hapijs/discuss/issues/425

Upvotes: 1

Related Questions