HTTP::Promise::Body - HTTP Message Body Class
use HTTP::Promise::Body; my $body = HTTP::Promise::Body->new || die( HTTP::Promise::Body->error, "\n" );
v0.1.0
This class represents an entity body.
Here is how it fits in overall relation with other classes.
+-------------------------+ +--------------------------+ | | | | | HTTP::Promise::Request | | HTTP::Promise::Response | | | | | +------------|------------+ +-------------|------------+ | | | | | | | +------------------------+ | | | | | +--- HTTP::Promise::Message |---+ | | +------------|-----------+ | | +------------|-----------+ | | | HTTP::Promise::Entity | | | +------------|-----------+ | | +------------|-----------+ | | | HTTP::Promise::Body | | | +------------------------+
Returns a new array object containing the body lines.
Returns the body data as a scalar object.
Be mindful about the size of the body before you load it all in memory. You can get the size of the body with $body->length
$body->length
This is just an alias for "as_string"
This is an alias for "clone" in Module::Generic, which is inherited by this class.
This is a no-op and is superseded by inheriting classes.
Provided with a filehandle, or an HTTP::Promise::IO object and an hash or hash reference of options and this will print the body data to and returns true if it was successful, or sets an error and returns undef
undef
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
Module::Generic::File, Module::Generic::Scalar, Module::Generic::File::IO, Module::Generic::Scalar::IO
PerlIO::scalar
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.