capacitor-community / http

Community plugin for native HTTP
MIT License
208 stars 136 forks source link

Bug: Request integer results in JSONException #244

Open daniel-zero opened 2 years ago

daniel-zero commented 2 years ago

Describe the bug When the requested API returns an integer value the plugin will produce a JSONException error

2022-03-25 22:36:12.396 6531-6775/de.gratisbroker.android.mobileapp.stage E/Capacitor/Plugin: JSONException
org.json.JSONException: Value 1648256400000 of type java.lang.Long cannot be converted to JSONArray

To Reproduce Call a REST-API returning just an integer value as a result

Expected behavior The plugin should not try to parse an integer into JSON objects or arrays

duplicates: #211

SchneMa commented 2 years ago

Is there any workaround?