LeonDWong
LeonDWong

Reputation: 1

Why do I get a wrong keyName in Node.js?

For instance, I send a request like { "arr": [ 1, 2, 3, 4 ] } in front-end.Then I get a request.body in Node.js.But the request.body shows as { "arr[]": [ 1, 2, 3, 4 ] }.I can't find out what the wrong it is.I just receive a wrong keyname in my body's ojbect.How to deal with it?

Upvotes: 0

Views: 21

Answers (1)

Amadan
Amadan

Reputation: 198324

You are using jQuery.ajax with traditional set to false. It is not "wrong"; some frameworks or languages (notably PHP) expect it that way. If you do not, change the parameter to true.

Upvotes: 1

Related Questions