one-sdk-js icon indicating copy to clipboard operation
one-sdk-js copied to clipboard

[Feature Request] Support APIs with incorrect content-type

Open jnv opened this issue 3 years ago • 1 comments

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 otasync html response

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?

jnv avatar Feb 11 '22 13:02 jnv

So my workaround currently for this is to use JSON.parse directly (which is available at least since OneSDK ~1.2).

jnv avatar May 12 '22 10:05 jnv