in reply to Re^4: WWW::Mechanize, how to set action
in thread WWW::Mechanize, how to set action

yup. use firefox with the live http headers plugin (I'm not sure if that also shows the POST body). or use lynx with the -trace option, or configure your browser to use a HTTP::Proxy subclass and dump the content somewhere.

update: regarding HTTP::Proxy, HTTP::Proxy::BodyFilter::save looks interesting.

  • Comment on Re^5: WWW::Mechanize, how to set action

Replies are listed 'Best First'.
Re^6: WWW::Mechanize, how to set action
by mifflin (Curate) on Aug 08, 2005 at 19:36 UTC
    I tried the BodyFilter::save and it worked fine.
    However, what I ended up using was HeaderFilter::simple.
    It gave me enough information to show what I was missing.
    Thanks for your help.
    use warnings; use strict; use Data::Dumper; use HTTP::Proxy; use HTTP::Proxy::HeaderFilter::simple; use IO::File; my $proxy = HTTP::Proxy->new(port => 8081); $proxy->host(undef); my $filter = HTTP::Proxy::HeaderFilter::simple->new(\&myfilter); $proxy->push_filter(request => $filter); $proxy->start(); sub myfilter { my ($this, $headers, $message) = @_; print $headers->as_string(); for my $pair (split(/\&/, $message->content())) { my ($key, $value) = split(/=/, $pair); $value = '' unless defined $value; printf "%s = %s\n", $key, $value; } STDOUT->flush(); }