Download the PHP package sokil/php-rest-api-client without Composer
On this page you can find all versions of the php package sokil/php-rest-api-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package php-rest-api-client
REST API Client
Installation
Configuration
Base API URI
Any request may contain absolute path to REST API. If all requests performed to same api, you may define base path:
Base API URI must be without training slash.
Merging rules:
Base API URI | Request path | Actual Requested URI |
---|---|---|
Not defined | Absolute URI | Absolute URI |
Not defined | Relative URI | Error |
http://example.com | /resource | http://example.com/resource |
http://example.com/prefix | /resource | http://example.com/prefix/resource |
http://example.com | http://other.com/resource | http://other.com/resource |
http://example.com/prefix | http://other.com/resource | http://other.com/resource |
Usage
Creation of http client. Client is based on PSR-18 Http Client and PSR-17 Http Factories
Create request class
Calling of API endpoint:
Usage with OAuth authorization
REST client must be build with additional OAuth2 client argument
Your request class must implement OAuth2AuthorizationAwareInterface
Usage with token based authorization
REST client must be build with additional token secret provider client argument
Your request class must implement HeaderSecretAuthorizationAwareInterface
All versions of php-rest-api-client with dependencies
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/simple-cache Version ^1.0|^2.0|^3.0
psr/log Version >=1.0