Download the PHP package bayfrontmedia/multi-curl without Composer

On this page you can find all versions of the php package bayfrontmedia/multi-curl. 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 multi-curl

Multi cURL

A simple HTTP client to make single or asynchronous requests utilizing the cURL library.

License

This project is open source and available under the MIT License.

Author

Bayfront Media

Requirements

Installation

Usage

Single HTTP request

A base URL can be set so that future request-related methods do not have to specify the full endpoint. For example:

The cURL handle will be created automatically and be ready to use.

Asynchronous HTTP requests

Multiple HTTP requests can be made simultaneously instead of one after the other, thereby limiting the completion time to the duration of the single slowest request instead of the sum of all requests combined.

A base URL can be set so that future request-related methods do not have to specify the full endpoint. For example:

cURL handles must be made explicitly using the create() method before using.

Public methods

Async class only

Once a cURL handle has been created, the following methods can be used:

Request

Response


create

Description:

(Only available in Async class)

Create cURL handles with identifiers.

cURL handles must be created before they can be used.

Parameters:

Returns:

Example:


use

Description:

(Only available in Async class)

Sets current cURL handle.

Once the cURL handle has been created using create(), it can be used by specifying the ID of the handle you wish to use.

A Bayfront\MultiCurl\ClientException exception will be thrown if the ID does not exist.

Parameters:

Returns:

Throws:

Example:


execute

Description:

(Only available in Async class)

Execute the given cURL session.

The response methods will only return results after the execute() method has been called.

Parameters:

Returns:

Example:

See the above example for use().


getHandle

Description:

Returns the cURL handle.

A Bayfront\MultiCurl\ClientException exception will be thrown if the handle does not exist.

Parameters:

Returns:

Throws:


reset

Description:

Resets all request settings.

Parameters:

Returns:


close

Description:

Reset all settings and close the cURL handle(s).

NOTE: This method is called in the class destructor.

Parameters:

Returns:


setOptions

Description:

Sets an array of options for the cURL session.

Parameters:

Returns:

Example:


setHeaders

Description:

Sets an array of headers for the cURL session.

Parameters:

Returns:

Example:


setToken

Description:

Sets token authorization header using a given token.

Parameters:

Returns:


download

Description:

(Only available in Client class)

Initiates file download in the browser.

Parameters:

Returns:

Example:


get

Description:

Executes GET request, including optional data sent as query parameters.

Parameters:

Returns:

Example:


connect

Description:

Executes CONNECT request, including optional data.

Parameters:

Returns:


delete

Description:

Executes DELETE request, including optional data.

Parameters:

Returns:


head

Description:

Executes HEAD request, including optional data.

Parameters:

Returns:


options

Description:

Executes OPTIONS request, including optional data.

Parameters:

Returns:


patch

Description:

Executes PATCH request, including optional data.

Parameters:

Returns:


post

Description:

Executes POST request, including optional data.

Parameters:

Returns:


put

Description:

Executes PUT request, including optional data.

Parameters:

Returns:


trace

Description:

Executes TRACE request, including optional data.

Parameters:

Returns:


getHeaders

Description:

Returns array of headers from the previous request.

Parameters:

Returns:

Example:


getHeader

Description:

Returns single header value from the previous request, with optional default value if not existing.

Parameters:

Returns:

Example:


getBody

Description:

Returns body of the previous request, with optional default value if not existing.

Parameters:

Returns:

Example:


getErrorNumber

Description:

Returns error number of the previous request, or zero if no error exists.

Parameters:

Returns:

Example:


isError

Description:

Is previous request an error.

Parameters:

Returns:


getErrorMessage

Description:

Returns error message of the previous request, or an empty string if no error occurred.

Parameters:

Returns:


getStatusCode

Description:

Returns status code of the previous request, or zero if not existing.

Parameters:

Returns:


getInfo

Description:

Returns array of information about the previous request, a single option constant, or null if not existing.

Parameters:

For more information, see: curl_getinfo

Returns:


isInformational

Description:

Is status code informational.

Parameters:

Returns:


isSuccessful

Description:

Is status code successful.

Parameters:

Returns:


isRedirection

Description:

Is status code a redirection.

Parameters:

Returns:


isClientError

Description:

Is status code a client error.

Parameters:

Returns:


isServerError

Description:

Is status code a server error.

Parameters:

Returns:


isOk

Description:

Is status code OK (200).

Parameters:

Returns:


isForbidden

Description:

Is status code forbidden (403).

Parameters:

Returns:


isNotFound

Description:

Is status code not found (404).

Parameters:

Returns:


All versions of multi-curl with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-curl Version *
ext-json Version *
bayfrontmedia/php-array-helpers Version ^2.0
bayfrontmedia/php-mime-types Version ^2.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 bayfrontmedia/multi-curl contains the following files

Loading the files please wait ....