Benjamin_4 -3 Junior Poster in Training

i want to know how i can get a json response from my node.js server and display the response on my web page

`

var request = require("request"),
    username = req.body.username,
    password = req.body.password,
    url = "https://api.ecoachsolutions.com/main.php?ecoachsignin=1&server=remote&user="+username+"&pass="+password;


    console.log("url is "+url);
    request.get(
    {
        url : url
    },
    function (error, response, body) {
        // Do more stuff with 'body' here
       if (!error && response.statusCode == 200) {
        var json_body = JSON.parse(body);
        console.log(json_body); 
        var msg = json_body.profile.user;//this is the message i want to show on my web page(msg)
    console.log(msg); // get json response
  }
    }
);`
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.