Reputation: 1
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
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