https://kotlinlang.org logo
k

Kenneth

03/11/2019, 3:03 PM
Is there are prettier way to do this? (blocking)
Copy code
apiRequests.forEach {
        val result = <http://Fuel.post|Fuel.post>(Config.API_ENDPOINT)
                .jsonBody(jackson.writeValueAsString(it))
                .responseString()
        if(!result.second.isSuccessful) {
            failedApiRequests.add(it)
            println(result.second.responseMessage)
        }
    }