Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I'm facing an error while using fetch, that is only happening on ios companions

so the same app and specifically a line which does a fetch request, works on android phones and simulator, but on ios fitbit app I get this error thrown 

the data couldn't be read because it isn't in the correct format 

anyone has any idea ? I saw in some searches it's a common swift error
thank you

 

Best Answer
2 REPLIES 2

Are you definitely returning the response content type as application/json? Have you tried validating the json to ensure there aren't any encoding errors?

Best Answer

I used proxyman to track request done on ios and there was something sent differently in headers that was making the api return a bad request xml response which makes sense that json() was breaking

Best Answer
0 Votes