语法: ok, err = ngx.send_headers()
环境: rewrite_by_lua, access_by_lua*, content_by_lua**
指名把应答头发送出去。
自从 v0.8.3
版本开始,成功情况该函数返回 1
,否则返回 nil
和错误字符描述信息。
注意,在内容通过 ngx.say、ngx.print 输出或当 content_by_lua 存在时,ngx_lua 将自动发送头部内容,所以通常情况不需要手动发送应答头。
English source:
syntax: ok, err = ngx.send_headers()
context: rewrite_by_lua, access_by_lua*, content_by_lua**
Explicitly send out the response headers.
Since v0.8.3
this function returns 1
on success, or returns nil
and a string describing the error otherwise.
Note that there is normally no need to manually send out response headers as ngx_lua will automatically send headers out before content is output with ngx.say or ngx.print or when content_by_lua exits normally.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。