documented the new feature that ngx.exec accepts a Lua table as its "args" argument value.

This commit is contained in:
agentzh (章亦春) 2011-09-23 00:01:14 +08:00
Родитель fffdb93170
Коммит 6800229f00
3 изменённых файлов: 45 добавлений и 4 удалений

17
README
Просмотреть файл

@ -8,9 +8,9 @@ Status
This module is under active development and is already production ready.
Version
This document describes ngx_lua v0.3.1rc6
This document describes ngx_lua v0.3.1rc7
(<https://github.com/chaoslawful/lua-nginx-module/downloads>) released
on 22 September 2011.
on 23 September 2011.
Synopsis
# set search paths for pure Lua external libraries (';;' is the default path):
@ -1209,6 +1209,19 @@ Nginx API for Lua
...
}
The optional second "args" can be used to specify extra URI query
arguments, for example:
ngx.exec("/foo", "a=3&b=hello%20world")
Alternatively, you can pass a Lua table for the "args" argument and let
ngx_lua do URI escaping and string concatenation automatically for you,
for instance,
ngx.exec("/foo", { a = 3, b = "hello world" })
The result is exactly the same as the previous example.
Note that this is very different from ngx.redirect in that it's just an
internal redirect and no new HTTP traffic is involved.

Просмотреть файл

@ -13,7 +13,7 @@ This module is under active development and is already production ready.
Version
=======
This document describes ngx_lua [v0.3.1rc6](https://github.com/chaoslawful/lua-nginx-module/downloads) released on 22 September 2011.
This document describes ngx_lua [v0.3.1rc7](https://github.com/chaoslawful/lua-nginx-module/downloads) released on 23 September 2011.
Synopsis
========
@ -1391,6 +1391,20 @@ Named locations are also supported, but query strings are ignored. For example,
}
The optional second `args` can be used to specify extra URI query arguments, for example:
ngx.exec("/foo", "a=3&b=hello%20world")
Alternatively, you can pass a Lua table for the `args` argument and let ngx_lua do URI escaping and string concatenation automatically for you, for instance,
ngx.exec("/foo", { a = 3, b = "hello world" })
The result is exactly the same as the previous example.
Note that this is very different from [ngx.redirect](http://wiki.nginx.org/HttpLuaModule#ngx.redirect) in that
it's just an internal redirect and no new HTTP traffic is involved.

Просмотреть файл

@ -10,7 +10,7 @@ This module is under active development and is already production ready.
= Version =
This document describes ngx_lua [https://github.com/chaoslawful/lua-nginx-module/downloads v0.3.1rc6] released on 22 September 2011.
This document describes ngx_lua [https://github.com/chaoslawful/lua-nginx-module/downloads v0.3.1rc7] released on 23 September 2011.
= Synopsis =
<geshi lang="nginx">
@ -1351,6 +1351,20 @@ Named locations are also supported, but query strings are ignored. For example,
}
</geshi>
The optional second <code>args</code> can be used to specify extra URI query arguments, for example:
<geshi lang="lua">
ngx.exec("/foo", "a=3&b=hello%20world")
</geshi>
Alternatively, you can pass a Lua table for the <code>args</code> argument and let ngx_lua do URI escaping and string concatenation automatically for you, for instance,
<geshi lang="lua">
ngx.exec("/foo", { a = 3, b = "hello world" })
</geshi>
The result is exactly the same as the previous example.
Note that this is very different from [[#ngx.redirect|ngx.redirect]] in that
it's just an internal redirect and no new HTTP traffic is involved.