one-sdk-js
one-sdk-js copied to clipboard
[Feature Request] Support APIs with incorrect content-type
Some APIs are just implemented incorrectly and report incorrect content-type header, typically JSON returned as text/html.
So far we ran into this in following APIs:
- 7timer.info: https://www.7timer.info/bin/civillight.php?lon=50.1&lat=14.4&ac=0&unit=metric&output=json&tzshift=0
- otasync.me

I'd actually like to start integrating OTASync, but this is a blocker for me. While I think this could be handled on more deeply conceptual level, perhaps we could expose JSON.parse in maps for starters?
So my workaround currently for this is to use JSON.parse directly (which is available at least since OneSDK ~1.2).