Return HTTP Request body in Kotlin as simple as possible
ALL I want is to call a API, get the body, and return it from a function. It really looks like Kotlin/Java just makes it hard on purpose...
This is my function, I use Volley as a library:
class RestClient(val server: String, val ctx: Context) {
fun getText() : String {
// Instantiate the RequestQueue.
val queue = Volley.newRequestQueue(ctx)
val url = server;
var str = "";
// Request a string response from the provided URL.
val...