class HTTP::Server::Response

Overview

The response to configure and write to in an HTTP::Server handler.

The response status and headers must be configured before writing the response body. Once response output is written, changing the status and headers properties has no effect.

The HTTP::Server::Response is a write-only IO, so all IO methods are available in it.

A response can be upgraded with the upgrade method. Once invoked, headers are written and the connection IO (a socket) is yielded to the given block. This is useful to implement protocol upgrades, such as websockets.

Defined in:

wrench/http/server/response.cr

Instance Method Summary

Class methods inherited from class IO

super_copy(src : IO, dst : IO, &) : Int64 super_copy

Instance Method Detail

def compress_type : HTTP::CompressType | Nil #

[View source]
def encoding? : Bool #

[View source]