Skip to content

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

License

Notifications You must be signed in to change notification settings

PiotrPress/remoter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Remoter

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

Installation

$ composer require piotrpress/remoter

Example

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