我可以在空手道中保存/使用原始回复正文吗? [英] Can I save/use a raw reponse body in Karate?

查看:40
本文介绍了我可以在空手道中保存/使用原始回复正文吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要:

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

但是,response已被解析为JSON.是否可以获取原始文本版本?

But, response is already parsed into JSON. Is it possible to get the raw text version?

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

I tried using * text rawResponse = response but get the error no step-definition method match found for: text rawResponse = response

推荐答案

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

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

这篇关于我可以在空手道中保存/使用原始回复正文吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆