So I want to create a URL using URI, because I like doing that better than I like creating the URL by hand.
#!/usr/bin/perl use strict; use warnings; use English qw/-no_match_vars/; use URI; use URI::QueryParam; my $uri = URI->new(q{http://foo.bar/}); $uri->path(q{/baz/bak}); my %form = ( 'quux' => 'alpha jub jub', ); $uri->query_form(%form); print qq{$uri\n};
Gives me http://foo.bar/baz/bak?quux=alpha+jub+jub, when I want http://foo.bar/baz/bak?quux=alpha%20jub%20jub.
Is there a way to get URI to encode spaces in the query string using %20?
In reply to Forcing %20 using URI? by PopeFelix
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |