PHP code example of lemric / batch-request
1. Go to this page and download the library: Download lemric/batch-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/ */
lemric / batch-request example snippets
namespace App\Controller;
use Lemric\BatchRequest\BatchRequest;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\{Request, Response};
use Symfony\Component\Routing\Annotation\Route;
class DefaultController extends AbstractController
{
#[Route('/batch', name: 'batch')]
public function indexAction(Request $request, BatchRequest $batchRequest): Response
{
return $batchRequest->handle($request);
}
}
POST /batch