HTTP

HTTP::Response may have a different definition of success than you do

published on
This has bitten me before, so I thought it was worth writing about. This RT ticket explains it better than I can, but let me sum things up here. Consider this code: use LWP::UserAgent (); my $ua = LWP::UserAgent->new; my $response = LWP::UserAgent->get('http://example.com/foobar'); if ( $response->is_success ) { ... } 99 times out of 100, this will do what you mean. Occasionally it doesn’t. What is the definition of success? Read More...

On the status of HTTP::BrowserDetect

published on
One of the first modules I ever took over on CPAN is the venerable HTTP::BrowserDetect. I remember I was giving a talk at Toronto PerlMongers one night about a UserAgent parser I had worked very hard to build. When I was finished, one of the comments was “Why didn’t you just use HTTP::BrowserDetect”? The answer was pretty simple – I just didn’t know about it. After I got familiar with HTTP::BrowserDetect, I saw that it was on some levels better that what I had written, but that it needed some love. Read More...

Introducing HTTP::CookieMonster

published on
If you've ever had the pleasure of poking around in your WWW::Mechanize or LWP::UserAgent cookie_jar, you'll know it's not an entirely painless process. It's certainly not impossible, but it feels a bit like jumping through hoops. The cookie_jar functionality in LWP::UserAgent and the modules which inherit from it is provided by HTTP::Cookies. Before I go any further, I'd like to thanks Gisle Aas for HTTP::Cookies, which is a very important bit of code. Read More...

HTTP::BrowserDetect for all of your UserAgent parsing needs

published on
This module dates back to 1999, but as of late 2009 it had only been patched twice over a 5 year period. The RT queue was full of very good (but unapplied) patches. The world of browsers had also changed considerably over this 10 year period, making the module helpful but missing a lot of coverage. Since I didn't feel like rewriting this module,I took the time to contact the author about seeing if he'd allow me to apply the patches. Read More...