HttpBatchBundle is a plugin that allows you to packaging a set of requests by implementing multipart/batch
method for Symfony. This bundle will allow you to decrease requests count and lower costs welcomed.
HTTP multipart/batch
is a format for packaging multiple HTTP requests in a single request. You can read this draft for more detail: https://tools.ietf.org/id/draft-snell-http-batch-00.html
The easiest way to install HttpBatchBundle is through composer.
composer require ideasoft/http-batch-bundle
Don't forget to register in AppKernel.php
$bundles = [
...
new \Ideasoft\HttpBatchBundle\HttpBatchBundle()
];
Now lets configurate it!
Add a route for HttpBatchBundle like that to your routing.yml
http_batch:
resource: "@HttpBatchBundle/Controller/"
type: annotation
Register HttpBatchBundle services. Add this line to your services.yml
imports:
...
- { resource: "@HttpBatchBundle/Resources/config/services.yml" }
That's all. Now you can use http batch implementation on your symfony project.
Your batch request url is http://your-domain/batch.
You should post your batch request to this url.You can change it from routing.yml if you want. You can test it with Postman or anything else.
You're lucky! You can try https://github.com/IdeasoftLabs/http-batch-client