Skip to content
Client for http requests from the php script
PHP Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.gitignore
.travis.yml
README.md
composer.json
composer.lock

README.md

Api client

Build Status

Api client provide a way to make http request (to rest api, for example) with retrying ability. If response code >= 500, request will be retried several times. First retry in 1 second, second retry in 2 seconds, third retry in 4 seconds and so on, until 256 second limit was reach.

Usage

$response = Shaggyrec\PhpHttpClient\Client::getInstance('https://hostname.com')->post(
    '/path/to/resource',
    $requestJson,
    [
        'option' => '1',
        'anotherOption' => '1',
    ],
    [
        'X-User-Id' => '666'
    ]);
You can’t perform that action at this time.