This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

cURL to LUA to set Dahua Camera parameters
#3
(9 hours ago)admin Wrote: Method should be set to GET. What do you get in Logs after sending the request?

With the method set to GET it would log:
Code:
* arg: 1   * string: Error Bad Request! * arg: 2   * number: 400 * arg: 3   * table:    ["content-length"]     * string: 21    ["content-type"]     * string: text/plain;charset=utf-8    ["connection"]     * string: close
Which is simply bad request. Can I force the full url from beginning and specify url_on and url_off arguments instead of adding the body inside the function?

UPDATED while testing GET:
- by specifying the full size url_on and url_off it seems to be working with an else-if statement.
Code:
url_on = 'http://admin:xxxxxx@10.0.100.10/cgi-bin/configManager.cgi?action=setConfig&Encode%5b0%5d.MainFormat%5b0%5d.VideoEnable=true&Encode%5b0%5d.ExtraFormat%5b0%5d.VideoEnable=true' --skipped the middle part if (value == true) then res, err, hdrs = request({   url = url_on, }) else res, err, hdrs = request({   url = url_off, }) end
Reply


Messages In This Thread
RE: cURL to LUA to set Dahua Camera parameters - by xtech - 5 hours ago

Forum Jump: