Download the PHP package isoftware/http-client without Composer

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

About

This is a continuation of the Incutio PHP HTTP Client class. It's still one of the better standalone HTTP client classes out there. I'm just going to make it do more.

Of all I can find on the HTTP spec, body content is allowed with POST, PUT, and DELETE requests, so we allow you to send body content when using this client.

Instantiation

$client = new HttpClient('www.domain.com', 80);

Where the first argument is the domain and the second is the port. The port is optional and default to 80 if not provided.

If you'd like to instantiate on an https:// URL, add it to the domain:

$client = new HttpClient('https://www.domain.com');

This will automatically use port 443 when connecting.

Basic Authentication

If the API you are accessing using this library requires basic authentication:

$client->setAuthorization('username', 'password');

GET

$data can be an object or array. $headers should be an array

$client->get('/service/endpoint', $data, $headers);

POST

$data can be a string, object, or array. $headers should be an array

$client->post('/service/endpoint', $data, $headers);

PUT

$data can be a string, object, or array. $headers should be an array

$client->put('/service/endpoint', $data, $headers);

DELETE

$data can be a string, object, or array. $headers should be an array

$client->put('/service/endpoint', $data, $headers)

Headers

Content-Type on requests is no longer set by default.

If Accept is not set, it defaults to:

'text/xml,application/xml,application/xhtml+xml,text/html,text/plain,image/png,image/jpeg,image/gif,*/*'

Headers should be things like:

array('Accept'=>'application/json', 'Content-Type':'text/xml', 'etc')

$data and $headers are optional in all of these.

Referer

The Incutio library used to set the referer of a call as the last item called. I rarely find this helpful, so it's turned off by default now. To turn it back on:

$this->client->setPersistReferers(true);

Response Content

Get the content returned by the most recent URL call.

$client->getContent();

Response Headers

You can get just the status or all the headers from your most recent URL call:

$client->getStatus();
$client->getHeaders();

All versions of http-client with dependencies

PHP Build Version
Package Version
Requires php Version >=5.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 isoftware/http-client contains the following files

Loading the files please wait ....