You can upload file by URI
or File
. Upload DSL can include headers
and params
.
val fileUri = this.javaClass.getResource("/cat.gif").toURI()
val response = upload {
url("http://postman-echo.com/post")
file(fileUri)
headers {
...
cookies {...}
}
params {...}
}
val file = File(this.javaClass.getResource("/cat.gif").toURI())
val response = file.upload( string or url )
val fileUri = this.javaClass.getResource("/cat.gif").toURI()
val response = fileUri.upload( string or url )