Closed 0racle closed 4 years ago
You can do this with URI::Template:
use URI::Template;
my $template = URI::Template.new(template => 'http://localhost/endpoint{?foo,bar}');
$client.get($template.process(foo => 1, bar => 'simple text param'));
URI::Template
supports the variable expansion/templating described in RFC 6570.
I'd love to see that functionality more seamlessly accessible directly from Cro
.
Implemented in https://github.com/croservices/cro-http/commit/12bdacdee8, documentation in https://github.com/croservices/cro/commit/76a755dba2.
Currently there is no support for accepting a Hash or List of Pairs and converting them to query parameters in the GET request.
Example