HTTP::Promise::Body::Form::Field - HTTP Form Field Class
use HTTP::Promise::Body::Form::Field; my $f = HTTP::Promise::Body::Form::Field->new( name => 'picture', file => '/some/where/image.png', headers => [ conten_type => 'image/png' ], ); my $f = HTTP::Promise::Body::Form::Field->new( name => 'picture', # Module::Generic::File or HTTP::Promise::Body::File object are ok file => $file_object, headers => [ conten_type => 'image/png' ], ); my $f = HTTP::Promise::Body::Form::Field->new( name => 'fullname', body => "John Doe", ); my $f = HTTP::Promise::Body::Form::Field->new( name => 'fullname', body => \$some_content, ); my $f = HTTP::Promise::Body::Form::Field->new( name => 'fullname', # HTTP::Promise::Body::Scalar object is ok too body => $body_object, );
v0.1.0
This class represents a form field. This is used primarily in conjonction with HTTP::Promise::Body::Form::Data
Sets or gets the field body object.
Sets or gets an headers object
Returns true if the field body is an HTTP::Promise::Body::Scalar object, false otherwise.
Returns true if the field body is an HTTP::Promise::Body::File object, false otherwise.
Sets or gets the field name as a scalar object
This retrieves the field data as a new scalar object, regardless if it the field body is in memory or on file.
body
Whatever argument is provided, is passed through to "as_string" in HTTP::Promise::Body
Jacques Deguest <jack@deguest.jp>
HTTP::Promise, HTTP::Promise::Request, HTTP::Promise::Response, HTTP::Promise::Message, HTTP::Promise::Entity, HTTP::Promise::Headers, HTTP::Promise::Body, HTTP::Promise::Body::Form, HTTP::Promise::Body::Form::Data, HTTP::Promise::Body::Form::Field, HTTP::Promise::Status, HTTP::Promise::MIME, HTTP::Promise::Parser, HTTP::Promise::IO, HTTP::Promise::Stream, HTTP::Promise::Exception
Copyright(c) 2022 DEGUEST Pte. Ltd.
All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install HTTP::Promise, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTTP::Promise
CPAN shell
perl -MCPAN -e shell install HTTP::Promise
For more information on module installation, please visit the detailed CPAN module installation guide.