Serverless.Conn.Response

Query and update the HTTP response.


type Response

[]

An HTTP response.


type alias Status =

Basics.Int

An HTTP status code.


Updating


addHeader : ( String.String, String.String ) -> Serverless.Conn.Response.Response -> Serverless.Conn.Response.Response

Set a response header.

If you set the same response header more than once, the second value will override the first.


setBody : Serverless.Conn.Body.Body -> Serverless.Conn.Response.Response -> Serverless.Conn.Response.Response

Set the response body.


updateBody : (Serverless.Conn.Body.Body -> Serverless.Conn.Body.Body) -> Serverless.Conn.Response.Response -> Serverless.Conn.Response.Response

Updates the response body.


setStatus : Serverless.Conn.Response.Status -> Serverless.Conn.Response.Response -> Serverless.Conn.Response.Response

Set the response HTTP status code.


Misc

These functions are typically not needed when building an application. They are used internally by the framework. They are useful when debugging or writing unit tests.


init : Serverless.Conn.Response.Response

A response with an empty body and invalid status.


encode : Serverless.Conn.Response.Response -> Json.Encode.Value

JSON encode an HTTP response.