From 3dbdff70960ec8c7de7d5a54721a560941627e0b Mon Sep 17 00:00:00 2001 From: Yuzo Date: Thu, 22 Jan 2015 13:12:48 +0800 Subject: [PATCH] add params support in options --- libs/luci-lib-httpclient/luasrc/httpclient.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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]*)(.*)") -- 2.25.1