Created
September 15, 2022 20:55
-
-
Save s1monw1/f29b265e649d87b1eebf49f87824d0b8 to your computer and use it in GitHub Desktop.
This file contains 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
private fun requestContributor(name: String): Contributor { | |
val contributors = | |
with(client) { | |
val response = | |
Request.Builder().url(ENDPOINT).build().let { newCall(it).execute() } | |
val responseAsString = response.use { | |
it.body()?.source()?.readByteArray()?.let { String(it) } | |
?: throw IllegalStateException("No response from server!") | |
} | |
responseAsString.let { | |
LOG.debug("response from git api: $it\n") | |
mapper.readValue(it) | |
} | |
} | |
//... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment