Tiny http client

v0.3 2021-05-23 21:33 UTC

This package is auto-updated.

Last update: 2021-11-23 22:32:55 UTC


README

Installation

composer require mcmatters/ticl

Usage

<?php

declare(strict_types=1);

require 'vendor/autoload.php';

$client = new \McMatters\Ticl\Client();

try {
    $response = $client->get('http://example.com/api/user?token=test');
    $user = $response->json();
} catch (\McMatters\Ticl\Exceptions\RequestException $e) {
    $error = $e->asJson();
} catch (\Throwable $e) {
    $error = $e->getMessage();
}

Note

If you want something more customizable, then please use Guzzle