Hi, I try to write in a Gradle task an post of a a...
# ktor
m
Hi, I try to write in a Gradle task an post of a artifact.
Copy code
HttpClient().use {
      GlobalScope.launch {
        it.submitFormWithBinaryData {
          url {
            url(artifactRepository.get().baseUrl.clone().build())

            parameter("repository", repositoryName.get())

            headers {
              append("User-Agent", System.getProperty("os.name"))
            }
          }
        }
      }
    }
Unfortunately this ends up in the second run with
io.ktor.client.engine.ClientEngineClosedException: Client already closed
Anyone an idea how I can handle this?
ok … was my bad … using now
runBlocking {
as I need to wait for the result of this post