The new DNS over HTTPS JSON API is nice (and #ty for keeping it similar to Google’s; grassroots standards FTW) but you may want to look at quoting at least TXT
record responses.
curl 'https://cloudflare-dns.com/dns-query?ct=application/dns-json&name=google-public-dns-a.google.com&type=TXT'
returns:
{"Status": 0,"TC": false,"RD": true, "RA": true, "AD": false,"CD": false,"Question":[{"name": "google-public-dns-a.google.com.", "type": 16}],"Answer":[{"name": "google-public-dns-a.google.com.", "type": 16, "TTL": 3516, "data": ""http://xkcd.com/1361/""}]}
and the data
component in Answer
is malformed.