|
1 | | -# API Client Foundation for PHP 7.x |
| 1 | +# JSON tools for API Clients for PHP 7.x |
2 | 2 |
|
3 | | -[](https://travis-ci.org/php-api-clients/foundation) |
4 | | -[](https://packagist.org/packages/api-clients/foundation) |
5 | | -[](https://packagist.org/packages/api-clients/foundation/stats) |
6 | | -[](https://scrutinizer-ci.com/g/php-api-clients/foundation/?branch=master) |
7 | | -[](https://packagist.org/packages/api-clients/foundation) |
8 | | -[](https://appveyor-ci.org/php-api-clients/foundation) |
9 | | - |
10 | | -# Middleware |
11 | | - |
12 | | -Middlewares are passed into the client with the options argument. In this example the [`api-clients/middleware-delay`](https://github.com/php-api-clients/middleware-delay) is used. Adding middlewares to the client is simple, add an array to `$options` with `Options::MIDDLEWARE` as index cosisting of middleware class names. Optionally you can pass options for the middleware through the `$options` array. Simply add a new array inside the array with the middlware class name as index and pass the desired options into it. |
13 | | - |
14 | | -```php |
15 | | -$options = [ |
16 | | - Options::DEFAULT_REQUEST_OPTIONS => [ |
17 | | - \ApiClients\Middleware\Delay\DelayMiddleware::class => [ |
18 | | - \ApiClients\Middleware\Delay\Options::DELAY => 3, |
19 | | - ], |
20 | | - ], |
21 | | - Options::MIDDLEWARE => [ |
22 | | - \ApiClients\Middleware\Delay\DelayMiddleware::class, |
23 | | - ], |
24 | | -]; |
25 | | - |
26 | | -$client = new Client($loop, $container, $browser, $options); |
27 | | -``` |
| 3 | +[](https://travis-ci.org/php-api-clients/json) |
| 4 | +[](https://packagist.org/packages/api-clients/json) |
| 5 | +[](https://packagist.org/packages/api-clients/json/stats) |
| 6 | +[](https://scrutinizer-ci.com/g/php-api-clients/json/?branch=master) |
| 7 | +[](https://packagist.org/packages/api-clients/json) |
| 8 | +[](https://appveyor-ci.org/php-api-clients/json) |
28 | 9 |
|
29 | 10 | # License |
30 | 11 |
|
31 | 12 | The MIT License (MIT) |
32 | 13 |
|
33 | | -Copyright (c) 2016 Cees-Jan Kiewiet |
| 14 | +Copyright (c) 2017 Cees-Jan Kiewiet |
34 | 15 |
|
35 | 16 | Permission is hereby granted, free of charge, to any person obtaining a copy |
36 | 17 | of this software and associated documentation files (the "Software"), to deal |
|
0 commit comments