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

Skip to content

Commit 67b08ad

Browse files
[BrowserKit] Add response fetch to BrowserKit documentation
1 parent 74bae69 commit 67b08ad

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
@@ -321,6 +321,19 @@ dedicated web crawler or scraper such as `Goutte`_::
321321

322322
The feature to make external HTTP requests was introduced in Symfony 4.3.
323323

324+
Dealing with HTTP responses
325+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
326+
327+
When using the BrowserKit component, you may need to deal with responses of
328+
the requests you made. To do so, you need to call the ``getResponse()``
329+
method of the ``HttpBrowser`` object. This method retrieves the last response
330+
the browser received::
331+
332+
$browser = new HttpBrowser(HttpClient::create());
333+
334+
$browser->request('GET', 'https://foo.com');
335+
$response = $browser->getResponse();
336+
324337
Learn more
325338
----------
326339

0 commit comments

Comments
 (0)