Skip to content

Commit

Permalink
better examples for add and append in Mojo::Headers
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jun 2, 2013
1 parent 3f33a80 commit 0da1768
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/Mojo/Headers.pm
Expand Up @@ -240,6 +240,10 @@ Shortcut for the C<Accept-Ranges> header.
Add one or more header values with one or more lines.
# "Vary: Accept\x0d\x0a"
# "Vary: Accept-Encoding\x0d\x0a\x0d\x0a"
$headers->vary('Accept')->add(Vary => 'Accept-Encoding')->to_string;
=head2 allow
my $allow = $headers->allow;
Expand All @@ -253,11 +257,11 @@ Shortcut for the C<Allow> header.
Append value to header and flatten it if necessary.
# "Accept-Encoding"
$headers->append(Vary => 'Accept-Encoding')->vary;
# "Vary: Accept\x0d\x0a\x0d\x0a"
$headers->append(Vary => 'Accept')->to_string;
# "Accept, Accept-Encoding"
$headers->vary('Accept')->append(Vary => 'Accept-Encoding')->vary;
# "Vary: Accept, Accept-Encoding\x0d\x0a\x0d\x0a"
$headers->vary('Accept')->append(Vary => 'Accept-Encoding')->to_string;
=head2 authorization
Expand Down

0 comments on commit 0da1768

Please sign in to comment.