Sometimes the only possible way to communicate with an online service is through a web application intended for human consumption--dealing with cookies, forms and parsing of HTML, perhaps with the help of WWW::Mechanize and Web::Scraper.
When automating such a web application, it may be unsafe to assume that a specific request will always trigger a specific response. For example, requesting bank transactions from an Internet Banking server could result in a response containing:
Some of those "unexpected" or "undesired" responses may require special behaviour, in which case it isn't appropriate to simply
die on such responses. Moreover, some of those responses could potentially occur on any communication with the web application, creating the need to test for them at every single point that the web server is contacted.
This distribution aims to abstract away some of the code verbosity that would be required for this by providing Moose roles for:
This functionality doesn't seem to already exist on CPAN.
After release, I intend to almost immediately make this distribution a dependency of:
Some of the things I've considered while trying to decide on a name for the distribution:
switchconstruct for HTTP::Responses
Accordingly, I came up with these names over the time that I've been thinking about it:
At this stage,
HTTP::Response::Switch seems to be the least terrible name.