#How can I make an API call that ensures I get a consistently formatted JSON response back?

2 messages · Page 1 of 1 (latest)

late remnant
#

Writing an application with NodeJS has some incredibly cool applications, but it's a huge blocker if my output isn't strictly formatted. Sometimes I get newlines '\n' prepended to the output, and other times I get a description and then the output. In my case I just want raw JSON.

azure moth
#

Raw and JSON doesn't really make sense. You're getting the "Raw JSON". It will sometimes come with newlines. You can simply use a function to strip any occurences of it in the string.