PHP code example of sigmie / http

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

    

sigmie / http example snippets


use GuzzleHttp\Psr7\Uri;
use Sigmie\Http\Contracts\JSONResponse;
use Sigmie\Http\JSONClient;
use Sigmie\Http\JSONRequest;

$http = JSONClient::create(
    [
        "https://api.example.com/v1",
    ],
    [
        'connect_timeout' => 30 
    ]
);

$request = new JSONRequest('GET', new Uri('/campaigns'));

/** @var JSONResponse $response */
$response = $http->request($req);