Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mojo::content::multipart(3pm) [debian man page]

Mojo::Content::MultiPart(3pm)				User Contributed Perl Documentation			     Mojo::Content::MultiPart(3pm)

NAME
Mojo::Content::MultiPart - HTTP 1.1 multipart content container SYNOPSIS
use Mojo::Content::MultiPart; my $multi = Mojo::Content::MultiPart->new; $multi->parse('Content-Type: multipart/mixed; boundary=---foobar'); my $single = $multi->parts->[4]; DESCRIPTION
Mojo::Content::MultiPart is a container for HTTP 1.1 multipart content as described in RFC 2616. EVENTS
Mojo::Content::Multipart inherits all events from Mojo::Content and can emit the following new ones. "part" $multi->on(part => sub { my ($multi, $single) = @_; ... }); Emitted when a new Mojo::Content::Single part starts. $multi->on(part => sub { my ($multi, $single) = @_; return unless $single->headers->content_disposition =~ /name="([^"]+)"/; say "Field: $1"; }); ATTRIBUTES
Mojo::Content::MultiPart inherits all attributes from Mojo::Content and implements the following new ones. "parts" my $parts = $multi->parts; $multi = $multi->parts([]); Content parts embedded in this multipart content, usually Mojo::Content::Single objects. METHODS
Mojo::Content::MultiPart inherits all methods from Mojo::Content and implements the following new ones. "new" my $multi = Mojo::Content::MultiPart->new; Construct a new Mojo::Content::MultiPart object and subscribe to "read" event with default content parser. "body_contains" my $success = $multi->body_contains('foobarbaz'); Check if content parts contain a specific string. "body_size" my $size = $multi->body_size; Content size in bytes. "build_boundary" my $boundary = $multi->build_boundary; Generate a suitable boundary for content. "clone" my $clone = $multi->clone; Clone content if possible, otherwise return "undef". "get_body_chunk" my $chunk = $multi->get_body_chunk(0); Get a chunk of content starting from a specfic position. "is_multipart" my $true = $multi->is_multipart; True. SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>. perl v5.14.2 2012-09-05 Mojo::Content::MultiPart(3pm)

Check Out this Related Man Page

Mojo::Path(3pm) 					User Contributed Perl Documentation					   Mojo::Path(3pm)

NAME
Mojo::Path - Path SYNOPSIS
use Mojo::Path; my $path = Mojo::Path->new('/foo%2Fbar%3B/baz.html'); shift @{$path->parts}; say $path; DESCRIPTION
Mojo::Path is a container for URL paths. ATTRIBUTES
Mojo::Path implements the following attributes. "leading_slash" my $leading_slash = $path->leading_slash; $path = $path->leading_slash(1); Path has a leading slash. "parts" my $parts = $path->parts; $path = $path->parts([qw(foo bar baz)]); The path parts. # Part with slash push @{$path->parts}, 'foo/bar'; "trailing_slash" my $trailing_slash = $path->trailing_slash; $path = $path->trailing_slash(1); Path has a trailing slash. METHODS
Mojo::Path inherits all methods from Mojo::Base and implements the following new ones. "new" my $path = Mojo::Path->new; my $path = Mojo::Path->new('/foo%2Fbar%3B/baz.html'); Construct a new Mojo::Path object. "canonicalize" $path = $path->canonicalize; Canonicalize path. # "/foo/baz" Mojo::Path->new('/foo/bar/../baz')->canonicalize; "clone" my $clone = $path->clone; Clone path. "contains" my $success = $path->contains('/foo'); Check if path contains given prefix. # True Mojo::Path->new('/foo/bar')->contains('/'); Mojo::Path->new('/foo/bar')->contains('/foo'); Mojo::Path->new('/foo/bar')->contains('/foo/bar'); # False Mojo::Path->new('/foo/bar')->contains('/f'); Mojo::Path->new('/foo/bar')->contains('/bar'); Mojo::Path->new('/foo/bar')->contains('/whatever'); "merge" $path = $path->merge('/foo/bar'); $path = $path->merge('foo/bar'); $path = $path->merge(Mojo::Path->new('foo/bar')); Merge paths. # "/baz/yada" Mojo::Path->new('/foo/bar')->merge('/baz/yada'); # "/foo/baz/yada" Mojo::Path->new('/foo/bar')->merge('baz/yada'); # "/foo/bar/baz/yada" Mojo::Path->new('/foo/bar/')->merge('baz/yada'); "parse" $path = $path->parse('/foo%2Fbar%3B/baz.html'); Parse path. Note that %2F will be treated as "/" for security reasons. "to_abs_string" my $string = $path->to_abs_string; Turn path into an absolute string. "to_string" my $string = $path->to_string; Turn path into a string. SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>. perl v5.14.2 2012-09-05 Mojo::Path(3pm)
Man Page