https://httpbin.org/get?params[]=a¶ms[]=b¶ms[]=c
If you want to request with such a URL, do as follows
sample.rb
#!/usr/bin/env ruby
require 'httpclient'
url = 'https://httpbin.org/get'
query = {
'params[]' => ['a', 'b', 'c']
}
puts HTTPClient.get(url, query).body
test
$ ./sample.rb | jq '.args'
{
"params[]": [
"a",
"b",
"c"
]
}
Recommended Posts