Created
June 29, 2020 18:42
-
-
Save jetaggart/bdc2384a8be80b26ef331677ffb85708 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// android/app/src/main/java/io/getstream/thestream/services/BackendService.kt:42 | |
fun getUsers(): List<String> { | |
val request = Request.Builder() | |
.url("$apiRoot/v1/users") | |
.addHeader("Authorization", "Bearer $authToken") | |
.get() | |
http.newCall(request.build()).execute().use { response -> | |
val jsonArray = JSONObject(response.body!!.string()).getJSONArray("users") | |
return List(jsonArray.length()) { i -> | |
jsonArray.get(i).toString() | |
}.filterNot { it == user } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment