Maru v0.9.5 Maru.Helpers.Response

This module is a wrapper for request and response of maru.

Summary

Macros

Set assign

Get assigns

Set content_type

Set or delete header

Get headers

Get params

Make response by (maru_entity)[https://hex.pm/packages/maru_entity] or key-value pairs

Set status

Functions

html(conn, data)
json(conn, data)
redirect(conn, url, opts \\ [])

Make response by url redirect.

text(conn, data)

Macros

assign(key, value)

Set assign.

assigns()

Get assigns.

content_type(value)

Set content_type.

header(key, value)

Set or delete header.

headers()

Get headers.

params()

Get params.

present(payload, opts)

Make response by (maru_entity)[https://hex.pm/packages/maru_entity] or key-value pairs.

present(key, payload, opts)
status(value)

Set status.