in reply to Need Help with LWP

You could always sniff the wire with something like Ethereal to attempt to find any signifigant differences between the request that works (your browser) and the request that doesn't (LWP). It might seem like overkill but when you're stuck sometimes ya just gotta get down there and actually see what's going on.

Replies are listed 'Best First'.
Re^2: Need Help with LWP
by superfrink (Curate) on Nov 01, 2004 at 03:38 UTC
    Sometimes you want to see the HTTP and HTML without running "tcpdump".

    If you are using windows I recommend a HTTP prxoy called Proxomitron. If you can't run that then HTTP::Proxy only takes a few lines of perl (see 373013).
      Those could definitely work. The same kind of functionality can still be achieved with Ethereal just by utilizing its filterings. A display filter of 'http' or a capture filter of 'tcp port 80' would do the trick nicely. That is assuming this is all regular http traffic.
        Thanks for the advice. I installed Ethereal and compared the tcp packages when running Netscape and LWP, as well as LWP ones that work (a one-word street name) and those that don't (a two-word name). I am afraid, there is still nothing obvious so far. I have already implemented a workaround - now I use only the first word of the street name in a query, get a list of all records where the street name starts with that word, and look for the exact match. Hopefully, I'll eventually crack that bizarre issue..
        Thanks again. Finally, I found the reason. The website I query works as follows: (1) when the user clicks the "Search" button, the form data are POSTed to check if the record(s) exist, and if yes (2) a GET request is put together, which returns the actual result page. I was initially fooled into believing that the content I send is 'application/x-www-form-urlencoded', which was not what the website expected. After I commented out that line in my code, it works fine. Thanks to all who responded to my post.