Response

io.github.edadma.apion.Response
See theResponse companion class
object Response

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Response.type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def binary(content: Buffer, status: Int, additionalHeaders: Seq[(String, String)]): Response

Create a binary response with standard headers

Create a binary response with standard headers

Value parameters

additionalHeaders

Optional additional headers

content

Binary content

status

HTTP status code (default 200)

Attributes

def configure(headers: Seq[(String, String)]): Unit

Configure global default headers

Configure global default headers

Value parameters

headers

Map of headers to set globally

Attributes

def json[A : JsonEncoder](data: A, status: Int, additionalHeaders: Seq[(String, String)], encoding: String): Response

Create a JSON response with standard headers

Create a JSON response with standard headers

Value parameters

additionalHeaders

Optional additional headers

data

Data to be JSON encoded

status

HTTP status code (default 200)

Attributes

def noContent(additionalHeaders: Seq[(String, String)]): Response
def resetDefaultHeaders(): Unit

Reset default headers to original state

Reset default headers to original state

Attributes

def text(content: String, status: Int, encoding: String, additionalHeaders: Seq[(String, String)]): Response

Create a plain text response with standard headers

Create a plain text response with standard headers

Value parameters

additionalHeaders

Optional additional headers

content

Text content

status

HTTP status code (default 200)

Attributes