1Mojo::Content::Single(3U)ser Contributed Perl DocumentatiMoonjo::Content::Single(3)
2
3
4
6 Mojo::Content::Single - HTTP 1.1 Content Container
7
9 use Mojo::Content::Single;
10
11 my $content = Mojo::Content::Single->new;
12 $content->parse("Content-Length: 12\r\n\r\nHello World!");
13
15 Mojo::Content::Single is a container for HTTP 1.1 content as described
16 in RFC 2616.
17
19 Mojo::Content::Single inherits all attributes from Mojo::Content and
20 implements the following new ones.
21
22 "asset"
23 my $asset = $content->asset;
24 $content = $content->asset(Mojo::Asset::Memory->new);
25
26 The actual content.
27
29 Mojo::Content::Single inherits all methods from Mojo::Content and
30 implements the following new ones.
31
32 "body_contains"
33 my $found = $content->body_contains('1234567');
34
35 Check if content contains a specific string.
36
37 "body_size"
38 my $size = $content->body_size;
39
40 Content size in bytes.
41
42 "get_body_chunk"
43 my $chunk = $content->get_body_chunk(0);
44
45 Get a chunk of content starting from a specfic position.
46
47 "parse"
48 $content = $content->parse("Content-Length: 12\r\n\r\nHello World!");
49
50 Parse content.
51
53 Mojolicious, Mojolicious::Guides, <http://mojolicious.org>.
54
55
56
57perl v5.12.3 2010-08-17 Mojo::Content::Single(3)