Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. var getRequest=function(options){
  2. var body='';
  3. var req = http.get(options,function(response){
  4. response.on('data', function(chunk) {
  5. body+=chunk;
  6. }).on('end', function(chunk) {
  7. console.log("body");
  8. return JSON.parse(body);
  9.  
  10. }).on('error',function(error){
  11. console.log("error: "+error.getMessage());
  12. })
  13.  
  14. })
  15. return req;
  16.  
  17. };
  18.  
  19. var options={
  20. host:'localhost',
  21. port:'8080',
  22. method:'GET',
  23. path:'/stuff'
  24. };
  25.  
  26. TypeError: Converting circular structure to JSON
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement