I am making an API request to the Census API for my Node app. The response I am receiving is an XML string:
"[["POP","DATE","state"],
["735132","6","02"],
["735132","6","02"]]"
I would like to convert it into JSON. I have tried using npm xml2js but I am receiving the following error:
"Non-whitespace before first tag.
Line: 0
Column: 1
I dont understand XML, so its makes it difficult to comprehend the error message. Any good ideas how I can convert this response to JSON? Thanks in advance!
JSON.parse(your_string)