Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fc7ee50

Browse files
[BrowserKit] Add response management to BrowserKit documentation
1 parent 2b55713 commit fc7ee50

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

components/browser_kit.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,19 @@ dedicated web crawler or scraper such as `Goutte`_::
351351
'.table-list-header-toggle a:nth-child(1)'
352352
)->text());
353353

354+
Dealing with HTTP responses
355+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
356+
357+
When using the BrowserKit component, you may need to deal with responses of
358+
the requests you made. To do so, you need to call the ``getResponse()``
359+
method of the ``HttpBrowser`` object. This method retrieves the last response
360+
the browser received::
361+
362+
$browser = new HttpBrowser(HttpClient::create());
363+
364+
$browser->request('GET', 'https://foo.com');
365+
$response = $browser->getResponse();
366+
354367
Learn more
355368
----------
356369

0 commit comments

Comments
 (0)