toin0u / http-adapter
HttpAdapter PHP 5.3+ library
Installs: 114 392
Dependents: 3
Suggesters: 0
Security: 0
Stars: 6
Watchers: 1
Forks: 1
Open Issues: 1
pkg:composer/toin0u/http-adapter
Requires
- php: >=5.3.0
- ext-curl: *
Requires (Dev)
- guzzle/guzzle: @stable
- kriswallsmith/buzz: @stable
- satooshi/php-coveralls: ~0.6
- zendframework/zendframework: ~2.1
Suggests
- guzzle/guzzle: Enabling Guzzle allows you to use the GuzzleHttpAdapter
- kriswallsmith/buzz: Enabling Buzz allows you to use the BuzzHttpAdapter
- zendframework/zendframework: Enabling Zend Http allows you to use the ZendHttpAdapter
This package is auto-updated.
Last update: 2025-10-24 07:02:41 UTC
README
This PHP 5.3+ library provides you simple HTTP adapters.
Installation
This library can be found on Packagist. The recommended way to install this is through composer.
Edit compose.json and add:
{
"require": {
"toin0u/http-adapter": "~1.0"
}
}
And install dependecies:
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar install
Available adapters
CurlHttpAdapterto use cURL.BuzzHttpAdapterto use Buzz, a lightweight PHP 5.3 library for issuing HTTP requests.GuzzleHttpAdapterto use Guzzle, PHP 5.3+ HTTP client and framework for building RESTful web service clients.ZendHttpAdapterto use Zend Http Client.SocketHttpAdapterto use a socket.
Usage
<?php require 'vendor/autoload.php'; $adapter = new HttpAdapter\CurlHttpAdapter; $url = 'http://ifconfig.me/ip'; printf('IP: %s', $adapter->getContent($url)); // IP: 127.0.0.1
Contributing
Please see CONTRIBUTING for details.
Credits
Acknowledgment
This set of adapters comes originally from the Geocoder PHP library.
Support
Please open an issues in github
License
HttpAdapter is released under the MIT License. See the bundled LICENSE file for details.