PHP code example of rapira / http

1. Go to this page and download the library: Download rapira/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/ */

    

rapira / http example snippets


use Rapira\Sdk\Http\SapiRequestFactory;

$factory = new SapiRequestFactory(
    $serverRequestFactory, // Psr\Http\Message\ServerRequestFactoryInterface
    $uriFactory,           // Psr\Http\Message\UriFactoryInterface
    $uploadedFileFactory,  // Psr\Http\Message\UploadedFileFactoryInterface
    $streamFactory,        // Psr\Http\Message\StreamFactoryInterface
);

$request = $factory->create();

use Rapira\Sdk\Http\DispatcherRequestFactory;

$factory = new DispatcherRequestFactory(
    $serverRequestFactory,
    $uploadedFileFactory,
    $streamFactory,
);

$request = $factory->create($exchange); // Rapira\Http\Exchange