HTTP::Body::Builder::UrlEncoded - application/x-www-encoded
application/x-www-encoded
use HTTP::Body::Builder::UrlEncoded; my $builder = HTTP::Body::Builder::UrlEncoded->new(content => {'foo' => 42}); $builder->add_content('x' => 'y'); $builder->as_string; # => x=y
Create a new HTTP::Body::Builder::UrlEncoded instance.
The constructor accepts named arguments as a hash. The only allowed parameter is content. This parameter should be a hashref.
content
Each key/value pair in this hashref will be added to the builder by calling the add_content method.
add_content
If the value of one of the content hashref's keys is an arrayref, then each member of the arrayref will be added separately.
HTTP::Body::Builder::UrlEncoded->new(content => {'a' => 42, 'b' => [1, 2]});
is equivalent to the following:
my $builder = HTTP::Body::Builder::UrlEncoded->new; $builder->add_content('a' => 42); $builder->add_content('b' => 1); $builder->add_content('b' => 2);
Add new parameter in raw string.
Generate body as string.
To install HTTP::Body::Builder, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTTP::Body::Builder
CPAN shell
perl -MCPAN -e shell install HTTP::Body::Builder
For more information on module installation, please visit the detailed CPAN module installation guide.