FileContent

class FileContent(val filePath: String, val contentType: ContentType = ContentType.defaultForFilePath(filePath))

Class to create an Http body from a binary file

Constructors

Link copied to clipboard
fun FileContent(filePath: String, contentType: ContentType = ContentType.defaultForFilePath(filePath))

Functions

Link copied to clipboard
fun bulk(): OutgoingContent

Creates an Http body with the whole content of the file

Link copied to clipboard
fun stream(): OutgoingContent

Creates an Http body that streams the content of the file

Properties

Link copied to clipboard
val contentType: ContentType

Http ContentType to specify the type of the file

Link copied to clipboard
val filePath: String

Local path of the file