Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var getRequest=function(options){
- var body='';
- var req = http.get(options,function(response){
- response.on('data', function(chunk) {
- body+=chunk;
- }).on('end', function(chunk) {
- console.log("body");
- return JSON.parse(body);
- }).on('error',function(error){
- console.log("error: "+error.getMessage());
- })
- })
- return req;
- };
- var options={
- host:'localhost',
- port:'8080',
- method:'GET',
- path:'/stuff'
- };
- TypeError: Converting circular structure to JSON
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement