Skip to content

Instantly share code, notes, and snippets.

@streetsmartdev
Created October 20, 2019 07:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save streetsmartdev/1c2bf2db49dced3fd464f9b3325904d4 to your computer and use it in GitHub Desktop.
Save streetsmartdev/1c2bf2db49dced3fd464f9b3325904d4 to your computer and use it in GitHub Desktop.
val client = OkHttpClient()
val okRequest = Request.Builder()
.url("https://httpbin.org/get")
.build()
val responseResource: Response = client.newCall(okRequest).execute()
return responseResource.use {
responseResource.body?.string()!!
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment