Help finguring out what wrong with this code

" OpenSprinkler : Error manually controlling valve Connection Issue" this only happen when resp in the code reads nill

if (resp == nil) then
return “ERROR”, nil, “Connection Issue”

local lul_base_cmd =

    if  lul_settings.NewModeTarget == "Disable" then
      lul_cmd = lul_base_cmd .. 'en=0'
    elseif lul_settings.NewModeTarget == "Enable" then
      lul_cmd = lul_base_cmd .. 'en=1'

    local isOk, resp, err = os_http_call(lul_cmd)

    local taskHandle = TASK_HANDLE or -1

    if (isOk ~= "OK") then
      taskHandle = luup.task("Error enabling/disabling controller: " .. err, luupTaskReturns["Error"], MSG_CLASS, taskHandle)
      taskHandle = luup.task("", luupTaskReturns["Success"], "", taskHandle)
      luup.variable_set("urn:fowler-cc:serviceId:OpenSprinkler1", "ModeStatus", lul_settings.NewModeTarget, lul_device)

    if (TASK_HANDLE == nil) then
      TASK_HANDLE = taskHandle

    debug("OpenSprinkler : SetModeTarget : Exit")
    return 4

the http response it

  1. Request Method:GET
  2. Status Code:200 OK

the html text on the page displays


the swithc responds but i keep getting

so for some reason its reading the response code as nill