Skip to content

Instantly share code, notes, and snippets.

@rybalkinsd
Last active July 9, 2019 12:34
Show Gist options
  • Save rybalkinsd/6b51ed9a63127de39e1cf0930cb1ffab to your computer and use it in GitHub Desktop.
Save rybalkinsd/6b51ed9a63127de39e1cf0930cb1ffab to your computer and use it in GitHub Desktop.
Upload file to Google Drive via kohttp
val token = ...
val yourFile = ...
val response = httpPost {
url("https://www.googleapis.com/upload/drive/v3/files?uploadType=media")
header {
"Authorization" to "Bearer $token"
}
body {
file(yourFile)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment