node.js http json
I trying to develop a web app built on node.js that interacts with a PHP api. The following I trying to request a JSON object, that my PHP api creates.http.get(options, function(res) . console.log("Got response: " res.statusCode) The JSON format is natively supported by Node.js. Nothing needs to be added and no module inserted using require.Dont forget to install libxml2-dev since the SConstruct file uses the xml2-config one provided by the package to build the nodejs module. Nodejs json, node, nodejs.Read JSON File with Nodejs Option 1. In above step, I have created a sample JSON file. Now create ReadJsonFile.js and add following content.