1Mojo::Content::MultiParUts(e3r)Contributed Perl DocumentMaotjioo:n:Content::MultiPart(3)
2
3
4
6 Mojo::Content::MultiPart - HTTP 1.1 MultiPart Content Container
7
9 use Mojo::Content::MultiPart;
10
11 my $content = Mojo::Content::MultiPart->new;
12 $content->parse('Content-Type: multipart/mixed; boundary=---foobar');
13 my $part = $content->parts->[4];
14
16 Mojo::Content::MultiPart is a container for HTTP 1.1 multipart content
17 as described in RFC 2616.
18
20 Mojo::Content::MultiPart inherits all attributes from Mojo::Content and
21 implements the following new ones.
22
23 "parts"
24 my $parts = $content->parts;
25
26 Content parts embedded in this multipart content.
27
29 Mojo::Content::MultiPart inherits all methods from Mojo::Content and
30 implements the following new ones.
31
32 "body_contains"
33 my $found = $content->body_contains('foobarbaz');
34
35 Check if content parts contain a specific string.
36
37 "body_size"
38 my $size = $content->body_size;
39
40 Content size in bytes.
41
42 "build_boundary"
43 my $boundary = $content->build_boundary;
44
45 Generate a suitable boundary for content.
46
47 "get_body_chunk"
48 my $chunk = $content->get_body_chunk(0);
49
50 Get a chunk of content starting from a specfic position.
51
52 "parse"
53 $content = $content->parse('Content-Type: multipart/mixed');
54
55 Parse content.
56
58 Mojolicious, Mojolicious::Guides, <http://mojolicious.org>.
59
60
61
62perl v5.12.3 2010-08-12 Mojo::Content::MultiPart(3)