Data::Printer::Filter::Web - pretty-printing of HTTP/JSON/LWP/Plack/Dancer/Catalyst/Mojo...
filters = Web
You may also customize the look and feel with the following options (defaults shown):
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
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.
Because Perl has no
false tokens, many JSON parsers implement boolean objects to represent those. With this filter, you'll get "true" and "false" (which is what probably you want to see) instead of an object dump on those booleans. This module filters through the following modules:
Also, if you use
JSON::Typist to parse your JSON strings, a Data::Printer dump using this filter will always properly print numbers as numbers and strings as strings.
This filter is able to handle cookies from
Mojolicious frameworks. Other frameworks like
Catalyst rely on
HTTP::Cookies, which simply store them in a hash, not an object.
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