Upload files

Upload DSL

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 {...}
}

Upload File extensions

val file = File(this.javaClass.getResource("/cat.gif").toURI())
val response = file.upload( string or url )

Upload URI extensions

val fileUri = this.javaClass.getResource("/cat.gif").toURI()
val response = fileUri.upload( string or url )

Last updated