PHP code example of cirelramos / external-request

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

    

cirelramos / external-request example snippets


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


use Cirelramos\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="Cirelramos\ExternalRequest\Providers\ServiceProvider"