2017 © Pedro Peláez
 

library http-client

An http client implemention compatible with psr-7 http message.

image

larium/http-client

An http client implemention compatible with psr-7 http message.

  • Saturday, July 8, 2017
  • by andreas_kollaros
  • Repository
  • 1 Watchers
  • 1 Stars
  • 517 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 50 % Grown

The README.md

PSR-7 PHP Http Client

An http client wrapping curl php extension, compatible with PSR-7 Http Message interfaces., (*1)

Installation

You can install this library using Composer, (*2)

Composer from command line

In root directory of your project run through a console:, (*3)

$ composer require "larium/http-client":"~1.0"

Composer from composer.json

Include require line in your composer.json file, (*4)

{
    "require": {
        "larium/http-client": "~1.0"
    }
}

and run from console in the root directory of your project:, (*5)

$ composer update

Set up

After installation you must require autoload file from composer in to your boot php script., (*6)

<?php
require_once 'vendor/autoload.php';

Basic usage

Using message factory discovery

You can use factory discovery to find any Request class that implements PSR-7 HTTP Message interfaces, to create the Request instance., (*7)

<?php

use Larium\Http\Client;
use Http\Discovery\Psr17FactoryDiscovery;
use Psr\Http\Client\ClientExceptionInterface;

$request = Psr17FactoryDiscovery::findRequestFactory()->createRequest('GET', 'http://www.example.com');
$client = new Client();
try {
    $response = $client->sendRequest($request);
    # Response is a Psr\Http\Message\ResponseInterface instance implementation.
} catch (ClientExceptionInterface $e) {
    //Resolve exception from client.
}

The Versions

08/07 2017

dev-master

9999999-dev

An http client implemention compatible with psr-7 http message.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andreas Kollaros

http psr7 client

08/07 2017

1.2.1

1.2.1.0

An http client implemention compatible with psr-7 http message.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andreas Kollaros

http psr7 client

03/04 2017

1.2.0

1.2.0.0

An http client implemention compatible with psr-7 http message.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andreas Kollaros

http psr7 client

18/03 2017

1.1.0

1.1.0.0

An http client implemention compatible with psr-7 http message.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andreas Kollaros

http psr7 client

22/11 2015

1.0.1

1.0.1.0

An http client implemention compatible with psr-7 http message.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andreas Kollaros

http psr7 client

08/09 2015

1.0.0

1.0.0.0

An http client implemention compatible with psr-7 http message.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andreas Kollaros

http psr7 client