Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

saxulum-legacy/saxulum-http-client-adapter-joomla

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

saxulum-http-client-adapter-joomla

Build Status Total Downloads Latest Stable Version Scrutinizer Code Quality

Features

  • Provides a http client interface adapter for joomla

Requirements

  • PHP 5.3+
  • Joomla Http ~1.1

Installation

Through Composer as saxulum/saxulum-http-client-adapter-joomla.

Usage

use Saxulum\HttpClient\Joomla\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',
    )
));

You can inject your own joomla http instance while creating the http client instance.

use Joomla\Http\Http;
use Joomla\Http\Transport\Stream as StreamTransport;
use Saxulum\HttpClient\Joomla\HttpClient;

$options = array();
$transport = new StreamTransport($options);
$http = new Http($options, $transport);

$httpClient = new HttpClient($http);

IMPORTANT: The response protocol version is a fake, based on the request ones. Cause this http client does not support to set em.

About

A joomla adapter for the saxulum http client interface

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages