我需要解析一个POST调用标头,使用groovy脚本从位置URL获取id,并使用其他帖子的格式但是收到错误消息
def url = ('http://xxx.xxx.xxx.com/test_link/locatedat/125114');
def strArray = url.tokenize('/');
def fetchId = strArray.last();
log.info fetchId;
错误讯息:
groovy.lang.MissingMethodException: No signature of method: java.util.ArrayList.tokenize() is applicable for argument types: (java.lang.String) values: [/] Possible solutions: takeWhile(groovy.lang.Closure), takeWhile(groovy.lang.Closure) error at line: 3