Commit 3040b9ff authored by Henrik Elsner's avatar Henrik Elsner Committed by Oliver Bartsch
Browse files

[DOCS] Use correct method params in #90956 rst-file

Resolves: #94458
Releases: master, 10.4
Change-Id: Ief3e5f9ee91a15629f6254e4d56bd9050b642730
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69682

Reviewed-by: Mathias Brodala's avatarMathias Brodala <mbrodala@pagemachine.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
parent b914574b
......@@ -13,7 +13,7 @@ The short-hand method :php:`GeneralUtility::getUrl()` provides a
fast way to fetch the contents of a local file or remote URL.
For Remote URLs, TYPO3 v8 provides a object-oriented (PSR-7 compatible) way by using
the :php:`RequestFactory->request($url, $method)` API. Under the hood, the PHP library GuzzleHTTP is used,
the :php:`RequestFactory->request($url, $method, $options)` API. Under the hood, the PHP library GuzzleHTTP is used,
which evaluates what best option (e.g. curl library) should handle
the download to TYPO3.
......@@ -59,13 +59,13 @@ Sending additional headers with the HTTP request:
.. code-block:: php
$response = GeneralUtility::makeInstance(RequestFactory::class)->request($url, [$headers => ['accept' => 'application/json']);
$response = GeneralUtility::makeInstance(RequestFactory::class)->request($url, 'GET', ['headers' => ['accept' => 'application/json']]);
Finding additional information about the response:
.. code-block:: php
$response = GeneralUtility::makeInstance(RequestFactory::class)->request($url, [$headers => ['accept' => 'application/json']);
$response = GeneralUtility::makeInstance(RequestFactory::class)->request($url, 'GET', ['headers' => ['accept' => 'application/json']]);
if ($response->getStatusCode() >= 300) {
$content = $response->getReasonPhrase();
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment