I need to gather some data from an API from my Kotlin app and I need to parse a JSONs array from JS in a Kotlin array. This is the code that I'm using to do request to the API:
URL(apiUrl).readText()
And the output is something like this:
[{"id":5,"name":"Test1","ip":"192.168.0.1","port":10302,"id_slave":1},{"id":6,"name":"Test2","ip":"192.168.1.1","port":502,"id_slave":1}]
There's anyway to parse that string as a Kotlin array?