Download the PHP package johnshopkins/http-exchange without Composer

On this page you can find all versions of the php package johnshopkins/http-exchange. 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 http-exchange

HTTP Exchange

A collection of PHP HTTP client adapters to make swapping out HTTP client dependencies quick and easy.

Available adapters:

Requirements

Installation

To install the library, you will need to use Composer in your project.

Basic usage

Single request

Batch requests

Error handling

Single request

If a request fails, a HttpExchange\Exceptions\HTTP exception is thrown. See the exception methods documentation for more information.

Batch requests

Instead of throwing a HttpExchange\Exceptions\HTTP when any one of the requests in a batch request fails, the exception is instead returned. This allows your application to gracefully handle failed requests, while processing successful ones.

Alternatively, you can check which kind of object was returned from each request (HttpExchange\Response or HttpExchange\Exceptions\HTTP) and proceed accordingly:

Documentation

Initialization

Guzzle 6

Guzzle 7

Adapter methods

batch(array $requests)

Send multiple requests concurrently.

Returns: array containing the result of each request. A HttpExchange\Response object indicates a successful request while a HttpExchange\Exceptions\HTTP exception object indicates a failed request.

Arguments:

get(array $requests)

Make a GET request.

Returns: A HttpExchange\Response object. Throw a HttpExchange\Exceptions\HTTP exception object if the request fails.

Arguments:

post(array $requests)

Make a POST request.

Returns: A HttpExchange\Response object. Throw a HttpExchange\Exceptions\HTTP exception object if the request fails.

Arguments:

put(array $requests)

Make a PUT request.

Returns: A HttpExchange\Response object. Throw a HttpExchange\Exceptions\HTTP exception object if the request fails.

Arguments:

delete(array $requests)

Make a DELETE request.

Returns: A HttpExchange\Response object. Throw a HttpExchange\Exceptions\HTTP exception object if the request fails.

Arguments:

patch(array $requests)

Make a PATCH request.

Returns: A HttpExchange\Response object. Throw a HttpExchange\Exceptions\HTTP exception object if the request fails.

Arguments:

head(array $requests)

Make a HEAD request.

Returns: A HttpExchange\Response object. Throw a HttpExchange\Exceptions\HTTP exception object if the request fails.

Arguments:

options(array $requests)

Make an OPTIONS request.

Returns: A HttpExchange\Response object. Throw a HttpExchange\Exceptions\HTTP exception object if the request fails.

Arguments:

Response methods

getBody()

Get the body of the response.

Returns: SimpleXMLElement object if the response is XML. Object or array if the response is JSON.

getStatusCode()

Get the HTTP status code of the response;

Returns: Integer

Exception methods

All default methods available on PHP exceptions are available plus:

getStatusCode()

Get the HTTP status code of the response;

Returns: Integer


All versions of http-exchange with dependencies

PHP Build Version
Package Version
Requires php 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 johnshopkins/http-exchange contains the following files

Loading the files please wait ....