@@ -188,11 +188,12 @@ are errors, not warnings.
188
188
The default value is ON, unless it's being subclassed, in which
189
189
case it is OFF. This means that standalone L<WWW::Mechanize> instances
190
190
have autocheck turned on, which is protective for the vast majority
191
- of Mech users who don't bother checking the return value of get()
192
- and post() and can't figure why their code fails. However, if
193
- L<WWW::Mechanize> is subclassed, such as for L<Test::WWW::Mechanize>
194
- or L<Test::WWW::Mechanize::Catalyst> , this may not be an appropriate
195
- default, so it's off.
191
+ of Mech users who don't bother checking the return value of
192
+ C<L<< get()|/"$mech-> get( $uri )" >>>
193
+ and C<L<< post()|/"$mech-> post( $uri, content => $content )" >>> and can't
194
+ figure why their code fails. However, if L<WWW::Mechanize> is subclassed, such
195
+ as for L<Test::WWW::Mechanize> or L<Test::WWW::Mechanize::Catalyst> , this may
196
+ not be an appropriate default, so it's off.
196
197
197
198
=item * C<< noproxy => [0|1] >>
198
199
@@ -2656,6 +2657,28 @@ sub quiet {
2656
2657
return $self -> {quiet };
2657
2658
}
2658
2659
2660
+ =head2 $mech->autocheck(true/false)
2661
+
2662
+ Allows you to enable and disable autochecking.
2663
+
2664
+ Autocheck checks each request made to see if it was successful. This saves you
2665
+ the trouble of manually checking yourself. Any errors found are errors, not
2666
+ warnings. Please see C<L<< new|/"new()" > >> for more details.
2667
+
2668
+ $mech->autocheck(1); # turns on automatic request checking (the default)
2669
+ $mech->autocheck(0); # turns off automatic request checking
2670
+ $mech->autocheck(); # returns the current autocheck status
2671
+
2672
+ =cut
2673
+
2674
+ sub autocheck {
2675
+ my $self = shift ;
2676
+
2677
+ $self -> {autocheck } = $_ [0] if @_ ;
2678
+
2679
+ return $self -> {autocheck };
2680
+ }
2681
+
2659
2682
=head2 $mech->stack_depth( $max_depth )
2660
2683
2661
2684
Get or set the page stack depth. Use this if you're doing a lot of page
0 commit comments