Erlang 编程/使用 yaws 创建 Web 应用程序/Out 函数
外观
out/1 函数由 Yaws 在 Web 应用程序作者编写的任何模块中调用,作为入口点。
提供给 out/1 的应用参数是 arg 数据结构,此记录包含导致 out/1 函数调用的 Yaws 请求数据。
Yaws 解析 out/1 函数的返回值,并根据返回值执行适当的操作,因此只能从 out/1 发送一定数量的有效返回值
{html, DeepList}
{ehtml, Term}
{content, MimeType, Content}
{streamcontent, MimeType, FirstChunk}
{streamcontent_with_timeout, MimeType, FirstChunk, Timeout}
{header, H}
{connection, What}
{location, Url}
{cache_control, What}
{set_cookie, Cookie}
{content_type, MimeType}
{content_length, Len}
{header, "My-X-Header: gadong"}
{allheaders, HeaderList}
{status, Code}
break
ok
{redirect, Url}
{redirect_local, Path}
{get_more, Cont, State}
{page, Page}
{page, {Options, Page}}
{ssi, File, Delimiter, Bindings}
{bindings, [{Key1, Value2}, {Key2, Value2} .....]}
{yssi, YawsFile}
[ListOfValues]