PHP code example of litermi / external-request

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

    

litermi / external-request example snippets


'providers' => [
    // ...
    Litermi\ExternalRequest\Providers\ServiceProvider::class,
],


use Litermi\ExternalRequest\ExternalServiceRequestService;

$baseUri = "yourdomain.com"
$requestPath = "/api/users"
$formParams = [];
$headers = [];

$method = "GET";
$response = ExternalServiceRequestService::execute(
    $baseUri,
    $method,
    $requestPath,
    $formParams,
    $header
);


$method = "POST";
$formParams = ["username":"cirel", "password":"you"];
$responsePost =  ExternalServiceRequestService::execute(
    $baseUri,
    $method,
    $requestPath,
    $formParams,
    $headers
);
sh
php artisan vendor:publish --provider="Litermi\ExternalRequest\Providers\ServiceProvider"