Download the PHP package shoxcie/batch-http-client without Composer

On this page you can find all versions of the php package shoxcie/batch-http-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package batch-http-client

Batch HTTP Client

HTTP request batch executor with individual retries, built on Symfony HttpClient.

Fire multiple HTTP requests in parallel. Each request retries independently without blocking others.

Requirements

Installation

Usage

Retries

Any non-2xx response or transport error (connection timeout, DNS failure) triggers a retry. Transport exception retries can be disabled per request with retryOnTransportException: false.

Retry options

Override options on retry with a static array:

Or dynamically with a Closure:

Retry options are merged onto the original options via array_replace_recursive().

Callbacks

Error handling

By default, if a request exhausts all retries, the last exception is rethrown and all in-flight requests are cancelled:

Set throwOnExhausted: false for optional requests. Failed optional requests return null in the results array:

Response decoding

By default, responses are decoded as JSON (toArray()). Set decodeJson: false to get raw content (getContent()):

Response parsing / validation

parseResponse runs after the body is decoded and before onSuccess, only on a 2xx response. The return value replaces the entry in the results array, so it doubles as a custom parser:

Throw InvalidResponseException from the parser to reject a semantically invalid 2xx response and trigger a retry (counts against maxRetries, fires onRetry, and on exhaustion fires onExhausted plus rethrows if throwOnExhausted: true):

Any other Throwable from the parser is treated as an unexpected error and routes to onAbort, cancelling the whole batch.

Custom HTTP client

Pass any HttpClientInterface implementation:

RequestConfig reference

Parameter Type Default Description
method string (required) HTTP method
url string (required) Request URL
options array [] Symfony HttpClient options
retryOptions array\|Closure [] Options merged on retry, or Closure receiving (string $key, int $retries, ExceptionInterface\|InvalidResponseException $e)
throwOnExhausted bool true Rethrow exception after retries exhausted
decodeJson bool true Decode response as JSON
maxRetries int 0 Maximum retry attempts
retryOnTransportException bool true Retry on transport errors (timeouts, DNS)
parseResponse Closure\|null null Runs on 2xx responses before onSuccess. Receives (string $key, int $retries, mixed $result, ResponseInterface $response); return value replaces the result. Throw InvalidResponseException to retry.

[!IMPORTANT] The user_data option is reserved for internal key correlation — passing it in options or retryOptions throws InvalidArgumentException.

Upgrading

See the upgrade/ folder for migration guides between major versions.

License

MIT — see LICENSE for details.


All versions of batch-http-client with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4 || ^8.5
symfony/http-client Version ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package shoxcie/batch-http-client contains the following files

Loading the files please wait ...