I'm writing simple program which has to change some data on Polish auction site.
One of the steps involves loading edit page, changing one value, and submitting it.
Sample page can be viewed here: http://depesz.com/various/new_item.php.html - this is just static copy of such edit page.
Relevant part of my perl code:
$agent->form_number( 1 );
$agent->submit();
$agent->form_number( 1 );
my $q = $agent->current_form()->find_input( 'scheme_id' );
$agent->field('scheme_id', '1025');
# $agent->field('description', encode('utf-8', $agent->value("description")));
# $agent->field('location', encode('utf-8', $agent->value("location")));
# $agent->field('transport_shipment_description', encode('utf-8', $agent->value("transport_shipment_description")));
$agent->submit;
print $agent->response->decoded_content . "\n";
After first submit I get the page I showed. Then I change value in scheme_id field to 1025, and submit the form.
Afterward I get:
HTTP::Message content must be bytes at /usr/local/share/perl/5.8.8/HTTP/Request/Common.pm line 91
I tried to recode values on text fields on the form - hence the agent->field(... encode) lines, but it didn't help.
At the moment I have no idea what on the form can make WWW::Mechanize fail in such way, but I clearly cannot fix in on my own.
Is there any way to debug this situation? Or perhaps I should do something differently?