如何在空手道框架的功能文件中正确传递表单字段范围?

How to pass the form field scope correctly in feature file of karate framework?

在我通过的功能文件中 并形成 field grant_type = 'client_credentials' 和表单字段 scope = '/api'

发布方法后,它在请求消息中反映为 grant_type=client_credentials&scope=**%2Fapi**

预计为

grant_type=client_credentials&scope=**/api**

谁能帮助解决这个问题,如何在 value ='/api' 的功能文件中传递表单字段范围?

空手道做的是对的,它是URL-对参数进行编码。也许你打算做 * method post - 然后你就不会在 URL 中看到它并感到困惑。

如果您的服务器端无法处理 scope=**%2Fapi**,则可能是您的服务器存在错误。

编辑:据发现,问题是使用的是非常旧的空手道版本:How to resolve the HeaderValueException for the post method API call with content type = 'application/x-www-form-urlencoded'?