File tree 1 file changed +37
-17
lines changed 1 file changed +37
-17
lines changed Original file line number Diff line number Diff line change @@ -56,27 +56,47 @@ If you need a more custom setup, define the services in your application configu
56
56
57
57
``` yaml
58
58
httplug :
59
- main_alias :
60
- client : httplug.client.default
61
- message_factory : httplug.message_factory.default
62
- uri_factory : httplug.uri_factory.default
63
- stream_factory : httplug.stream_factory.default
64
- classes :
65
- # uses discovery if not specified
66
- client : ~
67
- message_factory : ~
68
- uri_factory : ~
69
- stream_factory : ~
70
- clients :
71
- acme :
72
- adapter : guzzle5
73
- config :
74
- timeout : 2
75
- verify : false
59
+ main_alias :
60
+ client : httplug.client.default
61
+ message_factory : httplug.message_factory.default
62
+ uri_factory : httplug.uri_factory.default
63
+ stream_factory : httplug.stream_factory.default
64
+ classes :
65
+ # uses discovery if not specified
66
+ client : ~
67
+ message_factory : ~
68
+ uri_factory : ~
69
+ stream_factory : ~
70
+ ` ` `
71
+
72
+ #### Configure your client
73
+
74
+ You can configure your clients with some good default options. The clients are later registered as services.
75
+
76
+ ` ` ` yaml
77
+ httplug :
78
+ clients :
79
+ my_guzzle5 :
80
+ adapter : guzzle5
81
+ config :
82
+ # These options are given to Guzzle without validation.
83
+ base_url : ' http://google.se/'
84
+ defaults :
85
+ verify_ssl : false
86
+ timeout : 4
87
+ headers :
88
+ Content-Type : ' application/json'
89
+ acme :
90
+ adapter : guzzle6
91
+ config :
92
+ # These options are given to Guzzle without validation.
93
+ base_url : ' http://google.se/'
94
+
76
95
```
77
96
78
97
``` php
79
98
99
+ $httpClient = $this->container->get('httplug.my_guzzle5');
80
100
$httpClient = $this->container->get('httplug.acme');
81
101
```
82
102
You can’t perform that action at this time.
0 commit comments