saxulum / saxulum-http-client-adapter-zend

此包已被废弃,不再维护。没有推荐替代包。

Saxulum Http Client Adapter Zend

1.0.4 2014-10-24 19:36 UTC

This package is not auto-updated.

Last update: 2020-09-22 19:09:52 UTC


README

Build Status Total Downloads Latest Stable Version Scrutinizer Code Quality

特性

  • zend 提供http客户端接口适配器

需求

  • PHP 5.3+
  • Zend Http ~2.3

安装

通过 Composer 作为 saxulum/saxulum-http-client-adapter-zend 安装。

使用方法

use Saxulum\HttpClient\Zend\HttpClient;
use Saxulum\HttpClient\Request;

$httpClient = new HttpClient();
$response = $httpClient->request(new Request(
    '1.1',
    Request::METHOD_GET,
    'http://en.wikipedia.org',
    array(
        'Connection' => 'close',
    )
));

在创建http客户端实例时,您可以注入自己的zend客户端实例。

use Zend\Http\Client;
use Saxulum\HttpClient\Zend\HttpClient;

$client = new Client;
$httpClient = new HttpClient($client);