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

问题描述 投票:2回答:1

在我传递的特征文件和形式field grant_type = 'client_credentials'和形式字段scope = '/api'

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

预计为

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

任何人都可以帮助解决这个问题如何在value ='/api'的特征文件中传递表单字段范围?

cucumber karate
1个回答
1
投票

空手道正在做正确的事情,它是对参数进行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'?

© www.soinside.com 2019 - 2024. All rights reserved.