Karate 如何在负责人位置获取id?
对于我的POST请求,在responseHeaders中我得到Karate 如何在负责人位置获取id?,karate,Karate,对于我的POST请求,在responseHeaders中我得到1123的文件。 当我在功能文件中打印响应标题['location'][0]时,我会得到users/123。我怎么能只拿到身份证 这不是一个空手道问题,是吗:p 试试这个: * def location = responseHeaders['location'][0] * def userId = location.substring(location.lastIndexOf('/') + 1) * print userId 没错,
1
我只想打印id>123的文件。
当我在功能文件中打印响应标题['location'][0]时,我会得到
users/123
。我怎么能只拿到身份证 这不是一个空手道问题,是吗:p
试试这个:
* def location = responseHeaders['location'][0]
* def userId = location.substring(location.lastIndexOf('/') + 1)
* print userId
没错,JavaScript(甚至Java via)的所有功能都可以在空手道中使用 谢谢,这很有效。我将尝试在我的功能中使用更好的js