File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -351,23 +351,26 @@ current request like this::
351
351
352
352
$profile = $client->getProfile();
353
353
354
- Redirections
355
- ~~~~~~~~~~~~
354
+ Redirecting
355
+ ~~~~~~~~~~~
356
356
357
357
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::
360
360
361
+ // do something that would cause a redirect to be issued (e.g. fill out a form)
362
+
363
+ // follow the redirect
361
364
$crawler = $client->followRedirect();
362
365
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
364
367
``followRedirects() `` method::
365
368
366
369
$client->followRedirects();
367
370
368
371
$crawler = $client->request('GET', '/');
369
372
370
- // all redirections are executed
373
+ // all redirects are followed
371
374
372
375
// set Client back to manual redirection
373
376
$client->followRedirects(false);
You can’t perform that action at this time.
0 commit comments