I was just working on a page-size checking script.

I fetched images with LWP::UserAgent, and added one sensible check, whether the response was a success or not. Otherwise images not fetched properly, due to my code or the code of the page being incorrect, would report their size as the size of the 404 message.

However, the if($response->is_success) test was passed, even when the image wasn't there.

So I looked at the $response->status_line and it was 202, which when I looked it up, turned out to be an ambiguous, non-committal HTTP response.

If I tried to get the images with a regular browser, I see a 404, but when trying to fetch them with LWP::UserAgent, I'm getting 202?

I put a check in my code that the response is "200 OK" for the time being, but what's going on? Any ideas?



($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss')
=~y~b-v~a-z~s; print

In reply to Non-commital HTTP Response? by Cody Pendant

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.