请放心用testng-删除请求中出现错误

发布于 2025-02-02 05:30:09 字数 542 浏览 1 评论 0原文

“联系人”:[ “期望的项目列表,但可以输入“ int”。”

”在此处输入映像说明“

”在此处输入图像说明”

enter image description here

"contacts": [
"Expected a list of items but got type "int"."

enter image description here

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

等风来 2025-02-09 05:30:09

从错误看来,预期的put主体需要是一个数组,说{“ contacts”:[12,123]}。您给出的是{“联系人”:12}
有2个选项:

  1. 将整数放入数组中。 IE。 request.put(“联系人”,[联系])
  2. 由于您的删除请求已经处理了多个ID,因此为什么使用DataProvider,只需将数组发送到一个接触中即可。

From the error it looks like the expected PUT body needs to be an array say {"contacts":[12,123]}. What you are giving is {"contacts":12}
There are 2 options:

  1. Put the integer in an array. ie. request.put("contacts",[contact])
  2. since your delete request already handles multiple ids, why use dataprovider, simply send the array in one go in contacts.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文