POSTing a JSON matrix on Node destroys the structure
source link: https://www.codesd.com/item/posting-a-json-matrix-on-node-destroys-the-structure.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
POSTing a JSON matrix on Node destroys the structure
The JSON object that I am POSTing is losing its array structure when it hits the Node JS body-parser.
I am Posting a JSON object with the following structure:
{
FirstName: "Name",
LastName: "Name",
Cars: [
{
Make: "Ford",
Model: "Mustang"
}
]
However when the Node JS backend calls req.body object I get:
{
"FirstName":"Name",
"LastName":"Name",
"Cars[0][Make]":"Ford",
"Cars[0][Model]":"Mustang"
}
Any reason this does not come over as a JSON with a array of objects that I can parse?
Had something similar today sendign with JSON.stringify sorted it out
Related Articles
Are JSON diagrams necessary to define the structure of a JSON?
Finding nodes in the structure of the SQL tree
Removes certain elements from the numpy array without destroying the structure
edit something in a list & ldquo; of tuples lists & rdquo; structure without destroying the structure in python
How can I reduce a html template file without destroying the structure?
Manipulating the end point json data before moving to the display using express
Adding an xml node to the top of the file or reversing the loop
ExtJS: Destroy the window with the 'closeAction' config set to 'hide'
ajax POST a JSON array to the nodejs server deletes the keys
The most recent way to send HTTP POST with JSON payload in Grails
JavaScript / jQuery to download the file via POST with JSON data
Sending the JSON Matrix to the Google Sheet Script Web Service
Dojo - destroying the tooltip widget when the DOM node is destroyed
Sending the post with json using a spray?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK