{"id":740,"hash":"86e6f811ae5110dafdf64ef5abdcb61eef2c7690f090d3e908f79b5f7742ba92","pattern":"axios gives me converting circular structure to json error while sending the data","full_message":"My code is as shown below:\n\naxios.post('https://api.sandbox.xyz.com/v1/order/new', JSON.stringify({\n            \"request\": \"/v1/order/new\",\n            \"nonce\": 123462,\n\n            \"client_order_id\": \"20150102-4738721\",\n            \"symbol\": \"btcusd\",\n            \"amount\": \"1.01\",\n            \"price\": \"11.13\",\n            \"side\": \"buy\",\n            \"type\": \"exchange limit\"\n        }), config)\n        .then(function(response) {\n            console.log(response);\n            res.json({\n                data: JSON.stringify(response)\n            })\n        })\n        .catch(function(error) {\n            console.log(error);\n            res.send({\n                status: '500',\n                message: error\n            })\n        });\n\nNow it is saying that Unhandled promise rejection (rejection id: 2): TypeError: Converting circular structure to JSON  for the code res.json({data:JSON.stringify(response)})\n\nSo, is there anything missing in this code ?","ecosystem":"npm","package_name":"node.js","package_version":null,"solution":"axios.post('https://api.sandbox.xyz.com/v1/order/new', JSON.stringify({\n            \"request\": \"/v1/order/new\",\n            \"nonce\": 123462,\n            \"client_order_id\": \"20150102-4738721\",\n            \"symbol\": \"btcusd\",\n            \"amount\": \"1.01\",\n            \"price\": \"11.13\",\n            \"side\": \"buy\",\n            \"type\": \"exchange limit\"\n        }), config)\n        .then(function(response) {\n            res.send(response.data)\n        })\n        .catch(function(error) {\n            res.send({\n                status: '500',\n                message: error\n            })\n        });","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/45319090/axios-gives-me-converting-circular-structure-to-json-error-while-sending-the-dat","votes":45,"created_at":"2026-04-19T04:51:33.568131+00:00","updated_at":"2026-04-19T04:51:33.568131+00:00"}