TypeError Converting circular structure to JSON in nodejs

0 votes

Code :

 var formData = ({first_name:firstname,last_name:lastname,user_name:username, email:email,password:password});


  request.post({url:'http://localhost:8081/register', JSON: formData}, function(err, connection, body) {


exports.Register = function(req, res) {

    res.header("Access-Control-Allow-Origin", "*");

    console.log("Request data " +JSON.stringify(req));

This is a request package for node.js. But I am getting this error in return:

TypeError: Converting circular structure to JSON

Can someone help me with this?

May 13 in Java-Script by Kichu
• 19,040 points
2,201 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Java-Script

0 votes
1 answer

How to print a circular structure in a JSON-like format?

Hello, You can use util.inspect(object) in node.js. It automatically ...READ MORE

answered Apr 24, 2020 in Java-Script by Niroj
• 82,800 points
1,568 views
0 votes
1 answer

How do I turn a string to a json in Node.js?

Hello Kartik, Use the JSON function  JSON.parse(theString) ...READ MORE

answered Apr 24, 2020 in Java-Script by Niroj
• 82,800 points
444 views
0 votes
1 answer

Uncaught TypeError: Cannot use 'in' operator to search for '324'

Hello @kartik, You have a JSON string, not ...READ MORE

answered Jun 18, 2020 in Java-Script by Niroj
• 82,800 points
6,736 views
0 votes
1 answer

Error:jQuery.parseJSON throws “Invalid JSON” error due to escaped single quote in JSON

Hello @kartik, Striking a similar issue using CakePHP ...READ MORE

answered Jun 19, 2020 in Java-Script by Niroj
• 82,800 points
3,336 views
0 votes
1 answer

How to “pretty” format JSON output in Ruby on Rails?

Hello @kartik, Use the pretty_generate() function, built into later versions ...READ MORE

answered Jul 24, 2020 in Java-Script by Niroj
• 82,800 points
6,933 views
0 votes
1 answer

How to read an external local JSON file in JavaScript?

Hello @kartik, For reading the external Local JSON ...READ MORE

answered Sep 3, 2020 in Java-Script by Niroj
• 82,800 points
164,359 views
0 votes
1 answer

Start script missing error when running npm start

It seems that there is an undefined ...READ MORE

answered Feb 10 in Java by Soham
• 9,670 points
2,974 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,112 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP