ktor-http / io.ktor.http / ContentDisposition

ContentDisposition

class ContentDisposition : HeaderValueWithParameters

Represents Content-Disposition header value

Types

Parameters

object Parameters

Frequently used content disposition parameter names

Constructors

<init>

ContentDisposition(disposition: String, parameters: List<HeaderValueParam> = emptyList())

Represents Content-Disposition header value

Properties

disposition

val disposition: String

Content disposition value without parameters

name

val name: String?

Content disposition name (from parameter named name)

Inherited Properties

content

val content: String

header's content without parameters

parameters

val parameters: List<HeaderValueParam>

Functions

equals

fun equals(other: Any?): Boolean

hashCode

fun hashCode(): Int

withParameter

fun withParameter(key: String, value: String): ContentDisposition

Creates new with parameter appended

withParameters

fun withParameters(newParameters: List<HeaderValueParam>): ContentDisposition

Creates new with parameters appended

Inherited Functions

parameter

fun parameter(name: String): String?

The first value for the parameter with name comparing case-insensitively or null if no such parameters found

toString

open fun toString(): String

Companion Object Properties

Attachment

val Attachment: ContentDisposition

Content-Disposition: attachment

File

val File: ContentDisposition

Content-Disposition: file

Inline

val Inline: ContentDisposition

Content-Disposition: inline

Mixed

val Mixed: ContentDisposition

Content-Disposition: mixed

Companion Object Functions

parse

fun parse(value: String): ContentDisposition

Parse Content-Disposition header value

Extension Functions

charset

fun HeaderValueWithParameters.charset(): <ERROR CLASS>?

Extracts a Charset value from the given Content-Type, Content-Disposition or similar header value.