我从 swagger 导入的请求有问题。
我有一个看起来像的请求/m2m/fim/items?filter=(tags=DEVICE)&exclude=tags,objectClass,href,operations,attributes,metadata,factory&expand=properties&limit=20
使用 swagger 我可以测试它,如果我在 Postman 中导入它,它也可以工作。它给了我当前的请求:
curl -X GET \
'http://xx.xx.xxx.xxx/m2m/fim/items?filter=(tags%3DDEVICE)&exclude=tags%2CobjectClass%2Chref%2Coperat...' \
我的 SOAP 请求看起来像
"GET /m2m/fim/items?filter=%28tags%3DDEVICE%29&exclude=tags%2CobjectClass%2Chref%2Coperations%2Cattributes%2Cmetadata%2Cfactory&expand=properties&limit=20 HTTP/1.1[\r][\n]"
看起来“过滤器”参数的括号已针对请求进行了转换(邮递员不会发生这种情况),然后我的请求失败了。
谁能告诉我可以使用哪种语法,这样括号就不会被解释?
谢谢你
编辑:在我的 HTTP 日志中,我可以看到“Accept-Encoding: gzip,deflate”,这不是我想要的。在邮递员中,我有标题 Accept: application/json.
我知道如何从首选项中删除我当前的标题,但我不知道如何设置想要的标题。有人知道吗?
解决方案但不完整。
我发现了问题所在,我需要一个标题Accept: application/json
现在我的问题是以一种简单的方式将它添加到我所有测试用例中的所有请求中(我有超过 400 个请求)
亚历克斯