ServerHttpResponse

scamper.http.server.ServerHttpResponse
final class ServerHttpResponse(response: HttpResponse) extends AnyVal

Adds server extensions to HttpResponse.

Attributes

Graph
Supertypes
class AnyVal
trait Matchable
class Any

Members list

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.

Attributes

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

Attributes

Returns

new response

def setDeflateContentEncoding(bufferSize: Int): HttpResponse

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

Attributes

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

Attributes

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

Attributes

Returns

new response