PHP code example of helhum / typo3-frontend-request
1. Go to this page and download the library: Download helhum/typo3-frontend-request library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
helhum / typo3-frontend-request example snippets
$request = new \TYPO3\CMS\Core\Http\ServerRequest($uri);
$client = new \Helhum\Typo3FrontendRequest\Typo3Client();
try {
$response = $client->send($request);
$body = (string)$response->getBody();
} catch (\Helhum\Typo3FrontendRequest\RequestFailed $e) {
throw new \RuntimeException('Could not fetch page "' . $uri . '", reason: ' . $e->getMessage(), 1552081550, $e);
}