我可以在空手道中保存/使用原始响应body吗?



我想:

  1. 从响应正文(XML(获取原始文本
  2. 将其用作 JSON 请求正文中的字符串,如And request {"externalRawResponse": "#(response)"}

但是,response已经解析为 JSON。是否可以获得原始文本版本?

我尝试使用* text rawResponse = response但得到错误no step-definition method match found for: text rawResponse = response

是的,请阅读文档:https://github.com/intuit/karate#type-conversion

* xmlstring xml = response
* request { externalRawResponse: '#(xml)' }

最新更新