MutateHeaders

class MutateHeaders(override: Map<String, String> = emptyMap(), append: Map<String, String> = emptyMap(), setMissing: Map<String, String> = emptyMap()) : ModifyRequestMiddleware

HTTP middleware feature that allows mutation of in-flight request headers

Constructors

Link copied to clipboard
constructor(override: Map<String, String> = emptyMap(), append: Map<String, String> = emptyMap(), setMissing: Map<String, String> = emptyMap())

Functions

Link copied to clipboard
fun append(name: String, value: String)

Append a value to headers in the request that may already be set, setting the value if the key doesn't already exist

Link copied to clipboard
Link copied to clipboard
fun set(name: String, value: String)

Set a header in the request, overriding any existing key of the same name

Link copied to clipboard
fun setIfMissing(name: String, value: String)

Set a header with the given name only if the request does not already have a header set for the same name.

Inherited functions

Link copied to clipboard
open fun install(op: SdkHttpOperation<*, *>)

Register this transform with the operation's execution