An open API service indexing awesome lists of open source software.

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.

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' );
```