在空手道中发送空数组参数时,不会发送该参数。
Example:
Given url homeUrl
And path 'types'
And param filterTypes = []
When method GET
Then status 200
And mach response = '#[0]'
在调试模式下运行空手道我看到以下获取请求
在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
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)