Require8080.js

'use strict'; var request = require('request'); request.get( 'http://localhost:8080/getUserName?id=1234', function(err, res, body) { var result = JSON.parse(body); var name = result.value; request.get( 'http://localhost:8080/getUserStatus?id=1234', function(err, res, body) { var result = JSON.parse(body); var status = result.value; console.log('The status of user', name, 'is', status); }); });
Node JS

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.