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

Skip to content

Commit 8e943c7

Browse files
committed
Merge branch '4.4' into 5.4
* 4.4: [BrowserKit] Add response fetch to BrowserKit documentation
2 parents 3c97aee + f1f5f7d commit 8e943c7

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
@@ -357,6 +357,18 @@ dedicated web crawler or scraper such as `Goutte`_::
357357
``query``. They have to be passed as the default options argument to the
358358
client which is used by the HTTP browser.
359359

360+
Dealing with HTTP responses
361+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
362+
363+
When using the BrowserKit component, you may need to deal with responses of
364+
the requests you made. To do so, call the ``getResponse()`` method of the
365+
``HttpBrowser`` object. This method returns the last response the browser received::
366+
367+
$browser = new HttpBrowser(HttpClient::create());
368+
369+
$browser->request('GET', 'https://foo.com');
370+
$response = $browser->getResponse();
371+
360372
Learn more
361373
----------
362374

0 commit comments

Comments
 (0)