UnauthorizedResponse

class UnauthorizedResponse : NoContent

Response content with 401 Unauthorized status code and WWW-Authenticate header of supplied challenges

Parameters

challenges - to be passed with WWW-Authenticate header

Constructors

<init>

UnauthorizedResponse(vararg challenges: HttpAuthHeader)

Response content with 401 Unauthorized status code and WWW-Authenticate header of supplied challenges

Properties

challenges

vararg val challenges: Array<out HttpAuthHeader>

to be passed with WWW-Authenticate header

headers

val headers: Headers

Headers to set when sending this content

status

val status: HttpStatusCode?

Status code to set when sending this content

Extension Properties

caching

Gets or sets CacheControl instance as an extension property on this content

defaultVersions

val OutgoingContent.defaultVersions: List<Version>

Retrieves LastModified and ETag versions from this OutgoingContent headers

versions

Gets or sets list of Version instances as an extension property on this content

Extension Functions

toByteArray

suspend fun OutgoingContent.toByteArray(): ByteArray

toByteReadPacket

suspend fun OutgoingContent.toByteReadPacket(): ByteReadPacket

wrapHeaders

fun OutgoingContent.wrapHeaders(
    block: (Headers) -> Headers
): OutgoingContent

Generates a new OutgoingContent of the same abstract type but with OutgoingContent.headers transformed by the specified block.