| Current Path : /usr/local/share/man/man3/ |
| Current File : //usr/local/share/man/man3/Data::Printer::Filter::Web.3pm |
.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "Data::Printer::Filter::Web 3"
.TH Data::Printer::Filter::Web 3 "2021-02-19" "perl v5.26.3" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
Data::Printer::Filter::Web \- pretty\-printing of HTTP/JSON/LWP/Plack/Dancer/Catalyst/Mojo...
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
In your \f(CW\*(C`.dataprinter\*(C'\fR file:
.PP
.Vb 1
\& filters = Web
.Ve
.PP
You may also customize the look and feel with the following options (defaults shown):
.PP
.Vb 4
\& filter_web.show_class_name = 0
\& filter_web.expand_headers = 1
\& filter_web.show_redirect = 1
\& filter_web.show_request_in_response = 0
\&
\& # you can even customize your themes:
\& colors.filter_web_json_true = #ccffcc
\& colors.filter_web_json_false = #ffcccc
\& colors.filter_web_cookie = #0b3e21
\& colors.filter_web_method = #fefe33
\& colors.filter_web_uri = $fefe88
\& colors.filter_web_response_success = #fefe33
\& colors.filter_web_response_info = #fefe33
\& colors.filter_web_response_redirect = #fefe33
\& colors.filter_web_response_error = #fefe33
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
This is a filter plugin for Data::Printer. It filters through several
web-related objects and display their content in a (hopefully!) more userful
way than a regular dump.
.SH "PARSED MODULES"
.IX Header "PARSED MODULES"
.SS "\s-1JSON\s0"
.IX Subsection "JSON"
Because Perl has no \f(CW\*(C`true\*(C'\fR or \f(CW\*(C`false\*(C'\fR tokens, many \s-1JSON\s0 parsers implement
boolean objects to represent those. With this filter, you'll get \*(L"true\*(R" and
\&\*(L"false\*(R" (which is what probably you want to see) instead of an object dump
on those booleans. This module filters through the following modules:
.PP
\&\f(CW\*(C`JSON::PP\*(C'\fR, \f(CW\*(C`JSON::XS\*(C'\fR, \f(CW\*(C`JSON\*(C'\fR, \f(CW\*(C`JSON::MaybeXS\*(C'\fR, \f(CW\*(C`Cpanel::JSON::XS\*(C'\fR,
\&\f(CW\*(C`JSON\*(C'\fR, \f(CW\*(C`JSON::SL\*(C'\fR, \f(CW\*(C`Pegex::JSON\*(C'\fR, \f(CW\*(C`JSON::Tiny\*(C'\fR, \f(CW\*(C`JSON::Any\*(C'\fR,
\&\f(CW\*(C`JSON::DWIW\*(C'\fR and \f(CW\*(C`Mojo::JSON\*(C'\fR.
.PP
Also, if you use \f(CW\*(C`JSON::Typist\*(C'\fR to parse your \s-1JSON\s0 strings, a Data::Printer
dump using this filter will always properly print numbers as numbers and
strings as strings.
.SS "\s-1COOKIES\s0"
.IX Subsection "COOKIES"
This filter is able to handle cookies from \f(CW\*(C`Dancer\*(C'\fR/\f(CW\*(C`Dancer2\*(C'\fR and
\&\f(CW\*(C`Mojolicious\*(C'\fR frameworks. Other frameworks like \f(CW\*(C`Catalyst\*(C'\fR rely on
\&\f(CW\*(C`HTTP::CookieJar\*(C'\fR and \f(CW\*(C`HTTP::Cookies\*(C'\fR, which simply store them in a
hash, not an object.
.SS "\s-1HTTP REQUEST/RESPONSE\s0"
.IX Subsection "HTTP REQUEST/RESPONSE"
\&\f(CW\*(C`HTTP::Request\*(C'\fR and \f(CW\*(C`HTTP::Response\*(C'\fR objects are filtered to display
headers and content. These are returned by LWP::UserAgent,
WWW::Mechanize and many others.
.PP
If the response comes from chained redirects (that the source HTTP::Response
object knows about), this filter will show you the entire redirect chain
above the actual object. You may disable this by changing the
\&\f(CW\*(C`filter_web.show_redirect\*(C'\fR option.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
Data::Printer