Fragment

annotation class Fragment(val value: String = KTORGEN_DEFAULT_NAME, val encoded: Boolean = false)(source)

Add a hash mark # introduces the optional fragment near the end of the URL.

Applied to parameter, is obtained of it; else in function is required.

Generated code:

httpClient.request {
this.url {
// Only ONE fragment per URL is allowed
this.fragment = "some_anchor"
this.encodedFragment = "some_encoded_anchor"
}
}

See also

Properties

Link copied to clipboard
val encoded: Boolean = false

Specifies the value is already URL encoded.

Link copied to clipboard

A sequence of any characters. The resource itself defines the exact format of the fragment. Default the value of the function parameter.