Skip to content

Instantly share code, notes, and snippets.

@pahill
Created April 7, 2019 13:30
Show Gist options
  • Save pahill/120862c1613076be3e5dae4b7eb3cf03 to your computer and use it in GitHub Desktop.
Save pahill/120862c1613076be3e5dae4b7eb3cf03 to your computer and use it in GitHub Desktop.
@KtorExperimentalAPI
override suspend fun getInspiration(): URL? {
val httpClient = HttpClient(CIO)
val url = httpClient.get<String?>(INSPIROBOT_URL)
return if (url != null) {
URL(url)
} else {
null
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment