阵列参数的空手道0.9.6到1.0.1升级问题 [英] Karate 0.9.6 to 1.0.1 upgrade issue with array param

查看:10
本文介绍了阵列参数的空手道0.9.6到1.0.1升级问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在空手道中发送空数组参数时,不会发送该参数。

示例:

Given url homeUrl
And path 'types'
And param filterTypes = []
When method GET
Then status 200
And mach response = '#[0]'

在调试模式下运行空手道时,我看到以下GET请求

0.9.6版

获取https://{homeUrl}/types?filterTypes=%5B%5D

1.0.1版

获取https://{homeUrl}/types?

推荐答案

只使用字符串。下面这四行代码将在1.1.0上运行,试一试,自己看看。

* url 'https://httpbin.org/get'
* param foo = '[]'
* method get
* status 200
* match response.url == 'https://httpbin.org/get?foo=[]'

日志中的请求如下:

1 > GET https://httpbin.org/get?foo=%5B%5D
1 > Host: httpbin.org
1 > Connection: Keep-Alive
1 > User-Agent: Apache-HttpClient/4.5.13 (Java/11.0.11)
1 > Accept-Encoding: gzip,deflate

这篇关于阵列参数的空手道0.9.6到1.0.1升级问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆