Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matricali/php-http-client
Note that this is not a HTTP protocol implementation of its own. It is merely a wrapper of libcurl that implements PSR-7 HTTP message interface.
https://github.com/matricali/php-http-client
http-client http-protocol libcurl php5 php7 psr-7 wrapper
Last synced: 3 months ago
JSON representation
Note that this is not a HTTP protocol implementation of its own. It is merely a wrapper of libcurl that implements PSR-7 HTTP message interface.
- Host: GitHub
- URL: https://github.com/matricali/php-http-client
- Owner: matricali
- License: mit
- Created: 2018-02-03T02:56:17.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-22T12:50:38.000Z (about 2 years ago)
- Last Synced: 2024-10-01T02:41:21.737Z (4 months ago)
- Topics: http-client, http-protocol, libcurl, php5, php7, psr-7, wrapper
- Language: PHP
- Homepage: https://packagist.org/packages/jorge-matricali/http-client
- Size: 66.4 KB
- Stars: 7
- Watchers: 1
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[![Latest stable release](https://img.shields.io/badge/dynamic/json.svg?label=stable&url=https%3A%2F%2Fapi.github.com%2Frepos%2Fmatricali%2Fphp-http-client%2Freleases%2Flatest&query=%24.name&colorB=blue)](https://github.com/matricali/php-http-client/releases/latest)
[![Build Status](https://travis-ci.org/matricali/php-http-client.svg?branch=master)](:status:) [![Coverage Status](https://coveralls.io/repos/github/matricali/php-http-client/badge.svg?branch=master)](https://coveralls.io/github/matricali/php-http-client?branch=master)
[![MIT licensed](https://img.shields.io/github/license/matricali/php-http-client.svg)](https://matricali.mit-license.org/2017)
[![GitHub contributors](https://img.shields.io/github/contributors/matricali/php-http-client.svg)](https://github.com/matricali/php-http-client/graphs/contributors)PSR-7 HTTP Client (cURL)
========================Note that this is not an HTTP protocol implementation of its own. It is merely a
wrapper of _libcurl_ that implements [PSR-7](http://www.php-fig.org/psr/psr-7/) HTTP message interface.## Requirements
* PHP 5.4 or newer
* [cURL extension](http://php.net/manual/en/curl.installation.php)## Installation
```
composer require matricali/http-client
```## Usage
##### Sending GET request
```
use Matricali\Http\Client;$client = new Client();
$response = $client->get('http://www.example.com/');echo $response->getBody();
```##### Sending POST request
```
use Matricali\Http\Client;$client = new Client();
$payload = '{"name": "John Doe"}';
$response = $client->post('http://www.example.com/', $payload);echo $response->getBody();
```## Contributing
Contributions, issues, pull requests are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md)
## License
php-http-client is [MIT licensed](LICENSE.txt).