在 Qmetry 中执行 POST 请求时出错

问题描述

使用 Qmetry 框架,尝试执行以下 POST 请求(正文中包含 xml 内容)。由于客户保密,我没有在下面的代码中提到确切的 URL。

发布请求

post.sample.call={'headers':{'SoapAction':'<url here>','Content-Type':'text/xml;charset=UTF-8','Accept':'*/*','Authorization':'<authorization key here>'},'endPoint':'<endpoint here>','baseUrl':'<url here>','method':'POST','query-parameters':{},'form-parameters':{},'body':'<sending xml content here>'}

它抛出错误

Caused by: java.lang.IllegalArgumentException: Passed in key must select exactly one node: post.sample.call

这在通过邮递员运行时工作正常。但是 Qmetry 失败了。

要在 qmetry 中运行,需要对上述 post 方法进行任何更改吗?请告诉我。

解决方法

错误消息本身提供了原因!...

传入的key必须选择一个节点:post.sample.call

表示您可能有多个 post.sample.call 属性的条目或值。这里最有可能的问题是价值 ;; 用作列表分隔符,因此如果在属性值中需要,请在其前添加转义字符 \。例如

text/xml\;charset=UTF-8