Give access to important post() functionality in post_ok() #28

Open
wants to merge 1 commit into
from

Projects

None yet

3 participants

@mdorman
mdorman commented Jul 27, 2012

Let me state up front that I don't think there can be a solution to
this that allows users to use any set of arguments that would be valid
for post(), without breaking compatibility for those who have been
using post_ok() already.

However, I think that using the presence of a Content member in the
hashref of options to change our behavior allows users access to the
full capabilities of post() when using post_ok() (though they have to
rejigger their arguments a little bit), while preserving compatibility
for people who have been using this with its current interface.

This commit fixes issue #18.

@mdorman mdorman Make post_ok() more intelligent in how it passes args to post()
Let me state up front that I don't think there can be a solution to
this that allows users to use any set of arguments that would be valid
for post(), without breaking compatibility for those who have been
using post_ok() already.

However, I think that using the presence of a Content member in the
hashref of options to change our behavior allows users access to the
full capabilities of post() when using post_ok() (though they have to
rejigger their arguments a little bit), while preserving compatibility
for people who have been using this with its current interface.

This commit fixes issue #18.
a6229b7
@petdance petdance added the feature label Jul 5, 2016
@oalders oalders commented on the diff Jul 9, 2016
Mechanize.pm
@@ -220,7 +220,9 @@ sub head_ok {
=head2 $mech->post_ok( $url, [ \%LWP_options ,] $desc )
A wrapper around WWW::Mechanize's post(), with similar options, except
-the second argument needs to be a hash reference, not a hash. Like
+the second argument needs to be a hash reference, not a hash, and if
+you intend to set header, rather than just specify your form content,
@oalders
oalders Jul 9, 2016 Contributor

s/specify/specifying/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment