Skip to content

Commit

Permalink
show examples for unsupported formats in recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 29, 2014
1 parent c1cea55 commit 4f6e1e3
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lib/Mojolicious/Guides/Rendering.pod
Expand Up @@ -352,13 +352,16 @@ single render call.
And if no viable representation could be found, the C<any> fallback will be
used or an empty C<204> response rendered automatically.

# /hello -> "html"
# /hello (Accept: text/html) -> "html"
# /hello (Accept: text/xml) -> "xml"
# /hello.html -> "html"
# /hello.xml -> "xml"
# /hello?format=html -> "html"
# /hello?format=xml -> "xml"
# /hello -> "html"
# /hello (Accept: text/html) -> "html"
# /hello (Accept: text/xml) -> "xml"
# /hello (Accept: text/plain) -> undef
# /hello.html -> "html"
# /hello.xml -> "xml"
# /hello.txt -> undef
# /hello?format=html -> "html"
# /hello?format=xml -> "xml"
# /hello?format=txt -> undef
if (my $format = $self->accepts('html', 'xml')) {
...
}
Expand Down

0 comments on commit 4f6e1e3

Please sign in to comment.