Skip to content

Commit 5624d2d

Browse files
committed
Merge branch '6.0' into 6.1
* 6.0: [BrowserKit] Add response fetch to BrowserKit documentation
2 parents db62085 + d12c8f0 commit 5624d2d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

components/browser_kit.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,18 @@ dedicated web crawler or scraper such as `Goutte`_::
349349
``query``. They have to be passed as the default options argument to the
350350
client which is used by the HTTP browser.
351351

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

0 commit comments

Comments
 (0)