PHPackages                             sokil/php-rest-api-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. sokil/php-rest-api-client

ActiveLibrary[API Development](/categories/api)

sokil/php-rest-api-client
=========================

0.1.0(1y ago)04proprietaryPHPPHP ^8.2

Since Aug 31Pushed 1y ago1 watchersCompare

[ Source](https://github.com/sokil/php-rest-api-client)[ Packagist](https://packagist.org/packages/sokil/php-rest-api-client)[ RSS](/packages/sokil-php-rest-api-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (9)Versions (2)Used By (0)

REST API Client
===============

[](#rest-api-client)

Installation
------------

[](#installation)

```
$ composer require sokil/php-rest-api-client
```

Configuration
-------------

[](#configuration)

### Base API URI

[](#base-api-uri)

Any request may contain absolute path to REST API. If all requests performed to same api, you may define base path:

```
$restApiClient = new RestApiClient(
    $psrHttpClient,
    $psrRequestFactory,
    $psrUriFactory,
    null,
    null,
    "https://api.example.com/some-prefix"
);

```

Base API URI must be without training slash.

Merging rules:

Base API URIRequest pathActual Requested URINot definedAbsolute URIAbsolute URINot definedRelative URIError/resource/resourceUsage
-----

[](#usage)

Creation of http client. Client is based on PSR-18 Http Client and PSR-17 Http Factories

```
