Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/piotrpress/remoter

This library is a chainable HTTP Client based on file_get_contents() function.
https://github.com/piotrpress/remoter

chain chainable file-get-contents header headers http http-client httpclient php remoter request response url

Last synced: 7 days ago
JSON representation

This library is a chainable HTTP Client based on file_get_contents() function.

Awesome Lists containing this project

README

        

# Remoter

This library is a chainable HTTP Client based on [file_get_contents()](https://www.php.net/manual/en/function.file-get-contents.php) function.

## Installation

```shell
$ composer require piotrpress/remoter
```

## Example

```php
require __DIR__ . '/vendor/autoload.php';

use PiotrPress\Remoter\Request;
use PiotrPress\Remoter\Url;
use PiotrPress\Remoter\Header;

echo ( ( new Request(
( new Url(
'https://api.github.com'
) )->setPath( '/repos/PiotrPress/remoter' ),
'GET',
( new Header(
[ 'User-Agent' => 'PiotrPress/Remoter' ],
true
) )->set( 'Accept', 'application/vnd.github.v3+json' )
) )->send() )->getHeader()->get( 'code' );
```

## Requirements

PHP >= `7.4` version.

## License

[MIT](license.txt)