summaryrefslogtreecommitdiffhomepage
path: root/libs/luci-lib-httpclient/luasrc
diff options
context:
space:
mode:
authorYuzo <hyzgog@gmail.com>2015-01-22 13:12:48 +0800
committerYuzo <hyzgog@gmail.com>2015-01-22 13:12:48 +0800
commit3dbdff70960ec8c7de7d5a54721a560941627e0b (patch)
tree9e6aac054dedd8b495249bcae0f3d5dbd2328450 /libs/luci-lib-httpclient/luasrc
parentb6d4f32dcc4bba2645d3758c3dc027fe0e2b4d14 (diff)
add params support in options
Diffstat (limited to 'libs/luci-lib-httpclient/luasrc')
-rw-r--r--libs/luci-lib-httpclient/luasrc/httpclient.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/luci-lib-httpclient/luasrc/httpclient.lua b/libs/luci-lib-httpclient/luasrc/httpclient.lua
index af7969524..c76cc542e 100644
--- a/libs/luci-lib-httpclient/luasrc/httpclient.lua
+++ b/libs/luci-lib-httpclient/luasrc/httpclient.lua
@@ -97,7 +97,11 @@ end
function request_raw(uri, options)
options = options or {}
local pr, auth, host, port, path
-
+
+ if options.params then
+ uri = uri .. '?' .. http.urlencode_params(options.params)
+ end
+
if uri:find("%[") then
if uri:find("@") then
pr, auth, host, port, path = uri:match("(%w+)://(.+)@(%b[]):?([0-9]*)(.*)")