ServerHttpResponse

final implicit class ServerHttpResponse(response: HttpResponse) extends AnyVal

Adds server extensions to HttpResponse.

class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def request: Option[HttpRequest]

Optionally gets corresponding request.

Optionally gets corresponding request.

The request is not available if server could not read it or the server rejected it before it was read.

Note:

The request is the incoming request before handlers are applied; however, the message entity's input stream is an active object.

def setAttachment(file: File): HttpResponse

Creates new response with supplied file as attachment.

Creates new response with supplied file as attachment.

The Content-Type, Content-Length, and Content-Disposition headers are set accordingly.

Value parameters:
file

attachment

Returns:

new response

Adds deflate to Content-Encoding header and encodes message body.

Adds deflate to Content-Encoding header and encodes message body.

Value parameters:
bufferSize

size in bytes of buffer used to encode message body

Returns:

new response

def setGzipContentEncoding(bufferSize: Int): HttpResponse

Adds gzip to Content-Encoding header and encodes message body.

Adds gzip to Content-Encoding header and encodes message body.

Value parameters:
bufferSize

size in bytes of buffer used to encode message body

Returns:

new response

def setInline(file: File): HttpResponse

Creates new response with supplied file as inline content.

Creates new response with supplied file as inline content.

The Content-Type, Content-Length, and Content-Disposition headers are set accordingly.

Value parameters:
file

inline content

Returns:

new response