Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333] : superdoc . print w/replies, xml ) Need Help??
>I meant Data::Dump::dd
Ah.. glad I asked then :)

I compared output of the good server to one bad server (see below), for the failing test URL http://www.ranks.nl/images/test/intrend4kids.htm and noticed the _content fields in $response are indentical, but the headers are different. The good server seems to use an older version of libwww-perl judging by the default User Agents. Also it seems something is wrong with headers like "x-meta-description" => "X-Meta-DESCRIPTION" on the bad server.
I formatted the output a little for readability, and left out most of the _content field data because it would clutter the page.

bad server
do { require MIME::Base64; my $a = bless({ _content => MIME::Base64::d +ecode("ICAKICAKPCFET0NUWVBFIGh0bWw+PGh0bWwgPjxoZWFkPj...PC9odG1sPgog" +) , _headers => bless({ "::std_case" => { "client-date" => "Client-Date" , "client-peer" => "Client-Peer" , "client-response-num" => "Client-Response-Num" , "content-base" => "Content-Base", imagetoolbar => "Imagetoolbar" , "link" => "Link", title => "Title" , "x-meta-alexaverifyid" => "X-Meta-AlexaVerifyID" , "x-meta-author" => "X-Meta-Author" , "x-meta-contact-addr" => "X-Meta-Contact-Addr" , "x-meta-copyright" => "X-Meta-Copyright" , "x-meta-description" => "X-Meta-DESCRIPTION" , "x-meta-distribution" => "X-Meta-Distribution" , "x-meta-geo.position" => "X-Meta-Geo.Position" , "x-meta-geo.region" => "X-Meta-Geo.Region" , "x-meta-google-site-verification" => "X-Meta-Google-Site-Verificatio +n" , "x-meta-icbm" => "X-Meta-ICBM" , "x-meta-keywords" => "X-Meta-KEYWORDS" , "x-meta-language" => "X-Meta-Language" , "x-meta-rating" => "X-Meta-Rating" , "x-meta-robots" => "X-Meta-Robots" , "x-meta-viewport" => "X-Meta-Viewport" , "x-ua-compatible" => "X-UA-Compatible", } , "accept-ranges" => "bytes" , "client-date" => "Thu, 30 Apr 2015 07:35:44 GMT" , "client-peer" => "85.214.111.153:80" , "client-response-num" => 1, connection => "close" , "content-base" => "http://www.intrend4kids.com/template/" , "content-length" => 179664 , "content-type" => "text/html", date => "Thu, 30 Apr 2015 07:35:44 GM +T", expires => "Never", imagetoolbar => "no" , "last-modified" => "Sat, 25 Apr 2015 09:57:53 GMT" , "link" => [ "; media=\"print\"; rel=\"stylesheet\"; type=\"text/css\ +"" , "; rel=\"canonical\"" , "; rel=\"stylesheet\"" , "; rel=\"stylesheet\"" , "; rel=\"stylesheet\"; type=\"text/css\"" , "; rel=\"stylesheet\"; type=\"text/css\"", ], server => "Apache/2.2" +, title => pack("H*","aad8b4c7e8d2c2b9e9d3e0b4e7a12c20e0cad7e9cdbce9d +2e0b4e7a1b9d3e0a2e9d22c20a2cda7e0c5e8b9e0b4e7a1"), vary => "Accept-En +coding" , "x-meta-alexaverifyid" => "QHNj33aO6KQmcqiV_jK9Ymtp6Jc" , "x-meta-author" => "Intrend4Kids" , "x-meta-contact-addr" => "Intrend4Kids\@yahoo.com" , "x-meta-copyright" => "Intrend4Kids" , "x-meta-description" => MIME::Base64::decode("qNPLuejSwiAtIKrYtMfo0s +K56dPgtOehLCDgytfpzbzp0uC056G50+Ci6dIsIMrUuaTp0uC056EsIKLNp+DF6LngtOe +hLCCizafgxei55MHpLCCizafgxei5ure60rfKwcHYtdQsIKLNp+DF6LngysPUwb7RsrnS +odLDIC0gw9Kk0srYtKTY6cE=") , "x-meta-distribution" => "Global" , "x-meta-geo.position" => "13.681508;100.60699" , "x-meta-geo.region" => "TH" , "x-meta-google-site-verification" => "myAUzDVw80kwrha0IdLVY__MjBuXZh +v3xy5nfvYP-po" , "x-meta-icbm" => "13.681508, 100.60699" , "x-meta-keywords" => MIME::Base64::decode("qti0x+jSwrnp0+C056EsIODK1 ++nNvOnS4LTnobnT4KLp0iwgytS5pOnS4LTnoSwgos2n4MXoueC056EsIKLNp+DF6Lnkwe +ksIKLNp+DF6LngysPUwb7RsrnSodLDLCCizafgxei5ure60rfKwcHYtdQsIKLNp+Oq6eC +056E=") , "x-meta-language" => "en-th" , "x-meta-rating" => "General" , "x-meta-robots" => "all" , "x-meta-viewport" => "width=device-width, initial-scale=1.0 user-sca +lable=no" , "x-ua-compatible" => "", } , "HTTP::Headers"), _msg => "OK", _protocol => "HTTP/1.1", _rc => 200, + _request => bless({ _content => "", _headers => bless({ "user-agent" + => "libwww-perl/5.837" } , "HTTP::Headers"), _method => "GET", _uri => bless(do{\(my $o = "http +://www.ranks.nl/images/test/intrend4kids.htm")} , "URI::http"), _uri_canonical => 'fix', } , "HTTP::Request"), } , "HTTP::Response"); $a->{_request}{_uri_canonical} = \${$a->{_request +}{_uri}}; $a; }


good server
do { require MIME::Base64; my $a = bless({ _content => MIME::Base64::d +ecode("ICAKICAKPCFET0NUWVBFIGh0bWw+PGh0bWwgPjxoZWFkPj...PC9odG1sPgog" +) , _headers => bless({ "accept-ranges" => "bytes" , "client-date" => "Thu, 30 Apr 2015 07:34:41 GMT" , "client-peer" => "85.214.111.153:80" , "client-response-num" => 1, connection => "close" , "content-base" => "http://www.intrend4kids.com/template/" , "content-length" => 179664 , "content-type" => "text/html", date => "Thu, 30 Apr 2015 07:34:39 GM +T", expires => "Never", imagetoolbar => "no" , "last-modified" => "Sat, 25 Apr 2015 09:57:53 GMT" , "link" => [ "; media=\"print\"; rel=\"stylesheet\"; type=\"text/css\ +"" , "; rel=\"canonical\"" , "; rel=\"stylesheet\"" , "; rel=\"stylesheet\"" , "; rel=\"stylesheet\"; type=\"text/css\"" , "; rel=\"stylesheet\"; type=\"text/css\"", ], server => "Apache/2.2" +, title => pack("H*","aad8b4c7e8d2c2b9e9d3e0b4e7a12c20e0cad7e9cdbce9d +2e0b4e7a1b9d3e0a2e9d22c20a2cda7e0c5e8b9e0b4e7a1"), vary => "Accept-En +coding" , "x-meta-alexaverifyid" => "QHNj33aO6KQmcqiV_jK9Ymtp6Jc" , "x-meta-author" => "Intrend4Kids" , "x-meta-contact-addr" => "Intrend4Kids\@yahoo.com" , "x-meta-copyright" => "Intrend4Kids" , "x-meta-description" => MIME::Base64::decode("qNPLuejSwiAtIKrYtMfo0s +K56dPgtOehLCDgytfpzbzp0uC056G50+Ci6dIsIMrUuaTp0uC056EsIKLNp+DF6LngtOe +hLCCizafgxei55MHpLCCizafgxei5ure60rfKwcHYtdQsIKLNp+DF6LngysPUwb7RsrnS +odLDIC0gw9Kk0srYtKTY6cE=") , "x-meta-distribution" => "Global" , "x-meta-geo.position" => "13.681508;100.60699" , "x-meta-geo.region" => "TH" , "x-meta-google-site-verification" => "myAUzDVw80kwrha0IdLVY__MjBuXZh +v3xy5nfvYP-po" , "x-meta-icbm" => "13.681508, 100.60699" , "x-meta-keywords" => MIME::Base64::decode("qti0x+jSwrnp0+C056EsIODK1 ++nNvOnS4LTnobnT4KLp0iwgytS5pOnS4LTnoSwgos2n4MXoueC056EsIKLNp+DF6Lnkwe +ksIKLNp+DF6LngysPUwb7RsrnSodLDLCCizafgxei5ure60rfKwcHYtdQsIKLNp+Oq6eC +056E=") , "x-meta-language" => "en-th" , "x-meta-rating" => "General" , "x-meta-robots" => "all" , "x-meta-viewport" => "width=device-width, initial-scale=1.0 user-sca +lable=no" , "x-ua-compatible" => "", } , "HTTP::Headers"), _msg => "OK", _protocol => "HTTP/1.1", _rc => 200, + _request => bless({ _content => "", _headers => bless({ "user-agent" + => "libwww-perl/5.833" } , "HTTP::Headers"), _method => "GET", _uri => bless(do{\(my $o = "http +://www.ranks.nl/images/test/intrend4kids.htm")} , "URI::http"), _uri_canonical => 'fix', } , "HTTP::Request"), } , "HTTP::Response"); $a->{_request}{_uri_canonical} = \${$a->{_request +}{_uri}}; $a; }

In reply to Re^4: LPW $response->decoded_content different on different servers ? by Transalp
in thread LWP $response->decoded_content different on different servers ? by Transalp

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.