getUrl($this->MULTI_PARKING_SPACES_LAMP); $response = Http::timeout(3) ->withoutVerifying() ->withDigestAuth($this->device['username'], $this->device['password']) ->put($url, $body);//$this->getBody($color_occupy, $color_vacant, $is_flicker) } protected function getBody($color_occupy, $color_vacant, $is_flicker) { $is_flicker = (bool)$is_flicker; $body = [ "lampType" => "internal", "VehicleNumber" => [ "VehicleChannelNum" => 1, "VehicleChannelList" => [ [ "LampSoure" => "internal", // unrelated "VehicleNoExist" => [ "enabled" => true, "flashEnabled" => $is_flicker, "lampColor" => $color_vacant ], "VehicleExist" => [ "enabled" => true, "flashEnabled" => $is_flicker, "lampColor" => $color_occupy ] ] ] ], "replaceLampCtrl" => [ "enabled" => false, "ipV4Address" => "0.0.0.0", "portNo" => 80, "username" => "admin", "password" => "dddf4589f3430f7b7395bb9d35e05b27" ], "lampStatusArr" => [ [ "name" => "内置灯", "value" => "相机自控", "\$\$hashKey" => "062" ], [ "name" => "外置灯1", "value" => "相机自控", "\$\$hashKey" => "063" ], [ "name" => "外置灯2", "value" => "相机自控", "\$\$hashKey" => "064" ], [ "name" => "外置灯3", "value" => "相机自控", "\$\$hashKey" => "065" ] ] ]; return $body; } }