response.raw.XML和response.raw.responseText我都试过了,但是还是不行,不知道是这个函数用错了,还是其他地方的错,
具体写法:
apt.variables.set("api_show_id",response.raw.XML.show_id);
apt.variables.set("api_updatetime",response.raw.responseText.updatetime);
上面两行也是在网上找的,不太确定是不是对的。
用 apt.xml2json(response.raw.responseText)
将XML转换成JSON格式再调用。
完整代码类似:
let json = apt.xml2json(response.raw.responseText);
apt.variables.set("api_updatetime",json.updatetime);
执行完之后,没有获取到变量的值,下图:
let json = apt.xml2json(response.raw.responseText);
apt.variables.set("api_show_id",json.show_id);
apt.variables.set("api_show_id",json.root.show_id);
apt.variables.set("api_updatetime",json["updatetime"]);
我使用了这几种写法都不行