Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 675 Bytes

upload-files.md

File metadata and controls

34 lines (25 loc) · 675 Bytes

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 )