Navigation Menu

Skip to content

Commit

Permalink
better synopsis example for Mojo::Headers
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 14, 2012
1 parent 8f7631e commit e252a25
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions lib/Mojo/Headers.pm
Expand Up @@ -184,12 +184,15 @@ Mojo::Headers - Headers
# Parse
my $headers = Mojo::Headers->new;
$headers->parse("Content-Type: text/html\n\n");
$headers->parse("Content-Length: 42\r\n");
$headers->parse("Content-Type: text/html\r\n\r\n");
say $headers->content_length;
say $headers->content_type;
# Build
my $headers = Mojo::Headers->new;
$headers->content_length(9001);
$headers->content_length(42);
$headers->content_type('text/plain');
say $headers->to_string;
=head1 DESCRIPTION
Expand Down Expand Up @@ -414,7 +417,7 @@ Generate a list of all currently defined headers.
=head2 C<parse>
$headers = $headers->parse("Content-Type: text/foo\n\n");
$headers = $headers->parse("Content-Type: text/plain\r\n\r\n");
Parse formatted headers.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious.pm
Expand Up @@ -38,7 +38,7 @@ has static => sub { Mojolicious::Static->new };
has types => sub { Mojolicious::Types->new };

our $CODENAME = 'Rainbow';
our $VERSION = '3.30';
our $VERSION = '3.31';

# "These old doomsday devices are dangerously unstable.
# I'll rest easier not knowing where they are."
Expand Down

0 comments on commit e252a25

Please sign in to comment.