Subject: | post_ok's API does not match post |
The hashref of 'LWP options' for post_ok is passed to $mech->post as a
reference instead of as a list. This means that it is useless for
setting any request options (Content-Type is the one I care about here),
and can only set form parameters.
Compare (from post_ok):
$self->post( $url, \%opts );
vs. (from get_ok)
$self->get( $url, %opts );
I think ideally it would be:
$mech->post_ok($url, \%form_params, $desc);
or
$mech->post_ok($url, \@lwp_options, $desc);
(where @lwp_options could include \%form_params)
post_ok isn't documented to take an an arrayref now, so maybe the
behavior of passing in an arrayref could change?