空手道:如何从“responseHeaders”获取/存储“nonce”的值到下一个请求中使用的变量

问题描述 投票:1回答:1

我需要在responseheader中获取“nonce =”MTU1NjU2NDgxMTAzNjo1MTYzOTU5NmRhZjlmYTU2NjZlZjcxM2MwNDE1MzUyNA ==“”


karate
1个回答
1
投票

请尝试以下:

  • def Authenticate = responseHeaders ['WWW-Authenticate'] [0]
  • def myHeader = Authenticate.substring(Authenticate.lastIndexOf('“,')+ 2)

myHeader值为nonce =“MTU1NjU2NDgxMTAzNjo1MTYzOTU5NmRhZjlmYTU2NjZlZjcxM2MwNDE1MzUyNA ==”

© www.soinside.com 2019 - 2024. All rights reserved.