PHP code example of seeren / http

1. Go to this page and download the library: Download seeren/http library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

seeren / http example snippets


use Seeren\Http\Client\Client;
use Seeren\Http\Uri\Uri;

$client = new Client('GET', new Uri(
    'https',
    'packagist.org',
    'packages/seeren/http.json'
));
echo $client->sendRequest()->getBody();

use Seeren\Http\Uri\Uri;

$uri = new Uri('http', 'host');

use Seeren\Http\Uri\RequestUri;

$uri = new RequestUri();

use Seeren\Http\Stream\Stream;

echo new Stream('some-url', Stream::MODE_R);

use Seeren\Http\Stream\RequestStream;

echo new RequestStream();

use Seeren\Http\Stream\ResponseStream;

$stream = new ResponseStream();
$stream->write('Client output');

use Seeren\Http\Request\Request;
use Seeren\Http\Stream\RequestStream;
use Seeren\Http\Uri\RequestUri;

$request = new Request(
    new RequestStream(),
    new RequestUri()
);

use Seeren\Http\Response\Response;
use Seeren\Http\Stream\ResponseStream;

$response = new Response(
    new ResponseStream()
);