Skip to content

Instantly share code, notes, and snippets.

@skryvets
Created September 13, 2024 02:04
Show Gist options
  • Save skryvets/63198468ba030b3528d0bc34ec9f58d7 to your computer and use it in GitHub Desktop.
Save skryvets/63198468ba030b3528d0bc34ec9f58d7 to your computer and use it in GitHub Desktop.
Simple kotlin script
#!/usr/bin/env kotlin
@file:Repository("https://repo.maven.apache.org/maven2/")
@file:DependsOn("com.squareup.okhttp3:okhttp:4.12.0")
import okhttp3.OkHttpClient
import okhttp3.Request
val client = OkHttpClient()
val request = Request.Builder().url("https://example.com").build();
val response = client.newCall(request).execute()
print(response.body?.string())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment