abstract class BaseApplicationResponse : ApplicationResponse
Base class for implementing an ApplicationResponse
class BodyLengthIsTooLong : IllegalStateException, CopyableThrowable<BodyLengthIsTooLong>
Content's actual body size doesn't match the provided one in |
|
class BodyLengthIsTooSmall : IllegalStateException, CopyableThrowable<BodyLengthIsTooSmall>
Content's actual body size doesn't match the provided one in |
|
class InvalidHeaderForContent : IllegalStateException, CopyableThrowable<InvalidHeaderForContent>
OutgoingContent is trying to set some header that is not allowed for this content type.
For example, only upgrade content can set |
|
class ResponseAlreadySentException : IllegalStateException
Thrown when there was already response sent but we are trying to respond again |
BaseApplicationResponse(call: ApplicationCall)
Base class for implementing an ApplicationResponse |
open val
ByteBuffer pool |
|
val call: ApplicationCall |
|
open val cookies: ResponseCookies |
|
val pipeline: ApplicationSendPipeline |
fun commitHeaders(content: OutgoingContent): Unit
Commit header values and status and pass them to the underlying engine |
|
open fun push(builder: ResponsePushBuilder): Unit |
|
open suspend fun respondFromBytes(bytes: ByteArray): Unit
Respond with bytes content |
|
open suspend fun respondFromChannel(readChannel: ByteReadChannel): Unit
Respond from readChannel |
|
open suspend fun respondNoContent(content: NoContent): Unit
Process response with no content |
|
open suspend fun respondOutgoingContent(content: OutgoingContent): Unit
Process response outgoing content |
|
abstract suspend fun respondUpgrade(upgrade: ProtocolUpgrade): Unit
Process upgrade response |
|
open suspend fun respondWriteChannelContent(content: WriteChannelContent): Unit
Process response content using OutgoingContent.WriteChannelContent.writeTo. |
|
abstract suspend fun responseChannel(): ByteWriteChannel
Get response output channel |
|
abstract fun setStatus(statusCode: HttpStatusCode): Unit
Set underlying engine's response status |
|
open fun status(): HttpStatusCode? open fun status(value: HttpStatusCode): Unit |
val EngineResponseAtributeKey: AttributeKey<BaseApplicationResponse>
Attribute key to access engine's response instance. This is engine internal API and should be never used by end-users unless you are writing your own engine implementation |
fun setupSendPipeline(sendPipeline: ApplicationSendPipeline): Unit
Install an application-wide send pipeline interceptor into ApplicationSendPipeline.Engine phase to start response object processing via respondOutgoingContent |