Skip to content

Commit 6e4cad3

Browse files
committed
Tweaking redirects section
1 parent f3e8e71 commit 6e4cad3

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

book/testing.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -351,23 +351,26 @@ current request like this::
351351

352352
$profile = $client->getProfile();
353353

354-
Redirections
355-
~~~~~~~~~~~~
354+
Redirecting
355+
~~~~~~~~~~~
356356

357357
By default, the Client doesn't follow HTTP redirects, so that you can get
358-
the Response before the redirection. You next have to manually redirect by
359-
calling the ``followRedirect()`` method::
358+
and examine the Response before redirecting. Once you do want the client
359+
to redirect, call the ``followRedirect()`` method::
360360

361+
// do something that would cause a redirect to be issued (e.g. fill out a form)
362+
363+
// follow the redirect
361364
$crawler = $client->followRedirect();
362365

363-
But if you want the Client to automatically redirect, calls the
366+
If you want the Client to always automatically redirect, you can call the
364367
``followRedirects()`` method::
365368

366369
$client->followRedirects();
367370

368371
$crawler = $client->request('GET', '/');
369372

370-
// all redirections are executed
373+
// all redirects are followed
371374

372375
// set Client back to manual redirection
373376
$client->followRedirects(false);

0 commit comments

Comments
 (0)