When I use json.stringify via fetch, I'm encountering a problem with escaped quotes produced by json.stringify, resulting in a bad response. Manually removing the quotes solves the issue, but I need a way to automate this process.
var order = {
"from_country": "US",
"line_items": [
{
"quantity": 1,
"unit_price": 19.95
}
],
"to_country": "US"
};
var body = JSON.stringify(order);
The output of var body is:
{"from_country":"US","line_items":"[{\"quantity\": 1, \"unit_price\": 19.95}]","to_country":"US"}
I would prefer it to be displayed as:
{"from_country":"US","line_items":"[{"quantity": 1, "unit_price": 19.95}]","to_country":"US"}