File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -820,6 +820,7 @@ class YourApi extends Api
820820 {
821821 // set required base url
822822 $this->setBaseUrl('https://api.example.com/v1');
823+
823824 // set options as query defaults (will be included in all requests)
824825 $this->addQueryDefault('language', $this->options['language']);
825826 $this->addQueryDefault('timezone', $this->options['timezone']);
@@ -843,20 +844,15 @@ For the end user, it should look like this:
843844
844845``` php
845846$api = new YourApi([
846- 'language' => 'pt',
847- 'timezone' => 'Europe/Lisbon'
847+ 'language' => 'pt'
848848]);
849849
850- // GET https://api.example.com/v1/posts?language=pt&timezone=Europe/Lisbon &page=1
850+ // GET https://api.example.com/v1/posts?language=pt&timezone=UTC &page=1
851851$posts = $api->getPosts();
852852```
853853
854854For all available methods, check the official page documentation [ here] ( https://symfony.com/doc/current/components/options_resolver.html ) .
855855
856- ## Cookbook
857-
858- TODO
859-
860856## Contributing
861857
862858Any form of contribution to improve this library (including requests) will be welcome and appreciated.
You can’t perform that action at this time.
0 commit comments