webmcp
annotate framework/env/request/get_param_strings.lua @ 155:185e944182cb
Better C macros for null-marker in JSON library
| author | jbe |
|---|---|
| date | Thu Jul 31 03:18:04 2014 +0200 (2014-07-31) |
| parents | e75abc61d135 |
| children | 25a20bd1f416 |
| rev | line source |
|---|---|
| jbe@91 | 1 --[[-- |
| jbe@91 | 2 params = |
| jbe@91 | 3 param.get_param_strings() |
| jbe@91 | 4 |
| jbe@99 | 5 This function returns a table with all raw GET/POST parameters as strings or list of strings (except internal parameters like "_webmcp_path" or "_webmcp_id"). Modifications of the returned table have no side effects. |
| jbe@91 | 6 |
| jbe@91 | 7 --]]-- |
| jbe@91 | 8 |
| jbe@95 | 9 function request.get_param_strings() |
| jbe@99 | 10 local t = {} |
| jbe@99 | 11 for key, value in pairs(request._params) do |
| jbe@100 | 12 if type(value) == 'table' then |
| jbe@99 | 13 t[key] = table.new(value) |
| jbe@99 | 14 else |
| jbe@99 | 15 t[key] = value |
| jbe@99 | 16 end |
| jbe@99 | 17 end |
| jbe@99 | 18 return t |
| jbe@91 | 19 end |