https://github.com/fenzland/php-http-client
A lightweight HTTP client with PHP7.
https://github.com/fenzland/php-http-client
http http-client php php7
Last synced: 10 months ago
JSON representation
A lightweight HTTP client with PHP7.
- Host: GitHub
- URL: https://github.com/fenzland/php-http-client
- Owner: Fenzland
- License: mit
- Created: 2016-12-07T11:56:08.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-12-21T09:25:52.000Z (about 8 years ago)
- Last Synced: 2025-03-26T21:23:11.458Z (10 months ago)
- Topics: http, http-client, php, php7
- Language: PHP
- Size: 14.6 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Fenzland HTTP
================================
A lightweight HTTP client with PHP7.
# Install
```bash
composer require fenzland/http
```
# Usage
```php
HTTP::scheme('http')->host('example.org')->port(80)->query('/example/')->headers([ 'key'=>'value', ])->method('GET')->version('1.1')->send();
HTTP::withScheme('http')->withHost('example.org')->withPort(80)->withQuery('/example/')->withHeaders([ 'key'=>'value', ])->withMethod('GET')->withVersion('1.1')->send();
HTTP::url('http://example.org/example/?key=value')->get();
HTTP::url('http://example.org/example/?key=value')->head();
HTTP::url('http://example.org/example/?key=value')->options();
HTTP::url('http://example.org/example/?key=value')->delete();
HTTP::url('http://example.org/example/?key=value')->post( 'id=1&name=Fenz' );
HTTP::url('http://example.org/example/?key=value')->put( 'id=1&name=Fenz' );
HTTP::url('http://example.org/example/?key=value')->patch( 'id=1&name=Fenz' );
```