getFileList 设备目录文件列表

是否需要验证:是

控制客户端发送

GET /getFileList HTTP/1.1
auth: 验证串--触动专业版 iOS 无需写入验证串    
Root: [根类型:lua、res、log、plugin]     
Path: 路径
属性 说明
HTTP 方法 GET /getFileList HTTP/1.1
auth 验证串(触动专业版 iOS 无需写入验证串)
Root 根类型:lua、res、log、plugin,
要获取文件的触动精灵文件
Path 路径,例如 "/aaa" 或者 "/aaa/bbb";
多级路径下,前面带 '/';后面不带 ‘/’,根路径就是 "/"

服务返回

HTTP/1.0 200 OK
Content-Length: 143
Content-Type: text/html; charset=utf-8
{"ret":true,"Dirs":[],"Path":"\/","Files":["1436408889.lua","test.lua","main.ios.tsp","sz-ios.lua","sz-ios.lua.lua","ts1-ios.lua"],"Root":"lua"}
属性 说明
HTTP 返回消息 HTTP/1.0 200 OK
Content-Length 消息长度
Content-Type HTTP 消息类型:格式和编码
filelist 文件列表

文件列表返回值

属性 说明
ret true - 成功;false - 失败
Dirs 文件夹数组
Files 文件数组
Path 子路径
Root 根路径

HTTP 返回代码含义

返回代码 代码含义
200 成功

Lua 示例代码

require "ts"
--触动精灵端口号为 50005,小精灵端口号为 50015
--标准版或者小精灵需要加上参数 auth,示例使用客户端为 iOS 专业版
--10.0.0.63 为设备 IP 并且需要是局域网
header_send = {["Root"]="lua",["Path"]=""}
body_send = {}
status_resp, header_resp,body_resp = ts.httpGet("http://10.0.0.63:50005/getFileList", header_send, body_send)
if status_resp == 200 then
   nLog(header_resp)
    nLog(body_resp)
else
    dialog("获取失败",5)
end

注意事项

  • 安卓标准版、iOS 标准版及 iOS 专业版必须有授权,授权为试用状态无法调用。

  • 安卓 10 及其以上系统小精灵需要修改端口号为 50055。

Copyright 北京帮你玩科技有限公司 2023 all right reserved,powered by Gitbook该文章修订时间: 2024-03-06 17:50:18

results matching ""

    No results matching ""