Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
WWW::Mechanize::DecodeUsertContributed Perl DWWW::Mechanize::DecodedContent(3)

NAME
       WWW::Mechanize::DecodedContent -	decode Mech content using its HTTP
       response	encoding

SYNOPSIS
	 use WWW::Mechanize;
	 use WWW::Mechanize::DecodedContent;

	 my $mech = WWW::Mechanize->new;
	    $mech->get($url);

	 my $content = $mech->decoded_content || $mech->content;

DESCRIPTION
       WWW::Mechanize::DecodedContent is a plugin to add decoded_content
       utility method to WWW::Mechanize.

       NOTE If you're using WWW::Mechanize 1.50	or later, just use
       "$mech->content"	and it will return decoded content.

METHODS
       res->encoding
	   Because it loads HTTP::Response::Encoding module, it	automatically
	   adds	encoding method	to HTTP::Response class.

	     my	$enc = $mech->res->encoding;

	   Note	that $enc might	be empty if HTTP response header doesn't
	   contain valid charset attribute.

       decoded_content
	     my	$content = $mech->decoded_content;

	   returns HTML	as decoded using HTTP response encoding. Returns undef
	   if encoding is not specified. In that case you might	need to	get
	   the raw content using "$mech->content", and decode it using the
	   default encoding, which is likely to	be iso-8859-1.

AUTHOR
       Tatsuhiko Miyagawa <miyagawa@bulknews.net>

LICENSE
       This library is free software; you can redistribute it and/or modify it
       under the same terms as Perl itself.

SEE ALSO
       HTTP::Response::Encoding, WWW::Mechanize

perl v5.32.1			  2008-11-23 WWW::Mechanize::DecodedContent(3)

NAME | SYNOPSIS | DESCRIPTION | METHODS | AUTHOR | LICENSE | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=WWW::Mechanize::DecodedContent&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help