在空手道中发送空数组参数时,不发送参数。
的例子:
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}/类型? filterTypes = % 5 b % 5 d
在1.0.1版本
https://{homeUrl}/类型?
使用字符串。下面这四行代码可以在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