You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -37,32 +37,32 @@ public function registerBundles()
37
37
38
38
The usage documentation is split into two parts. First we explain how to configure the bundle in an application. The second part is for developing reusable Symfony bundles that depend on an HTTP client defined by the Httplug interface.
39
39
40
-
For information how to write applications with the services provided by this bundle, have a look at the [Httplug documentation](http://docs.httplug.io).
40
+
For information how to write applications with the services provided by this bundle, have a look at the [Httplug documentation](http://docs.php-http.org).
41
+
41
42
42
43
### Use in Applications
43
44
44
45
#### Custom services
45
46
46
-
47
47
| Service id | Description |
48
48
| ---------- | ----------- |
49
49
| httplug.message_factory | Service* that provides the `Http\Message\MessageFactory`
50
50
| httplug.uri_factory | Service* that provides the `Http\Message\UriFactory`
51
51
| httplug.stream_factory | Service* that provides the `Http\Message\StreamFactory`
52
52
| httplug.client.[name] | This is your Httpclient that you have configured. With the configuration below the name would be `acme_client`.
53
53
| httplug.client | This is the first client configured or a client named `default`.
54
-
| httplug.plugin.content_length <br> httplug.plugin.decoder<br> httplug.plugin.error<br> httplug.plugin.logger<br> httplug.plugin.redirect<br> httplug.plugin.retry | These are build in plugins that lives in the `php-http/plugins` package. These servcies are not public and may only be used when configure HttpClients or services.
54
+
| httplug.plugin.content_length <br> httplug.plugin.decoder<br> httplug.plugin.error<br> httplug.plugin.logger<br> httplug.plugin.redirect<br> httplug.plugin.retry | These are build in plugins that lives in the `php-http/plugins` package. These servcies are not public and may only be used when configure HttpClients or services.
55
55
56
56
\**These services are always an alias to another service. You can specify your own service or leave the default, which is the same name with `.default` appended. The default services in turn use the service discovery mechanism to provide the best available implementation. You can specify a class for each of the default services to use instead of discovery, as long as those classes can be instantiated without arguments.*
57
57
58
58
If you need a more custom setup, define the services in your application configuration and specify your service in the `main_alias` section. For example, to add authentication headers, you could define a service that decorates the service `httplug.client.default` with a plugin that injects the authentication headers into the request and configure `httplug.main_alias.client` to the name of your service.
59
59
60
60
```yaml
61
61
httplug:
62
-
clients:
62
+
clients:
63
63
acme_client: # This is the name of the client
64
64
factory: 'httplug.factory.guzzle6'
65
-
65
+
66
66
main_alias:
67
67
client: httplug.client.default
68
68
message_factory: httplug.message_factory.default
@@ -71,33 +71,34 @@ httplug:
71
71
classes:
72
72
# uses discovery if not specified
73
73
client: ~
74
-
message_factory: ~
74
+
message_factory: ~
75
75
uri_factory: ~
76
76
stream_factory: ~
77
77
```
78
78
79
+
79
80
#### Configure your client
80
81
81
-
You can configure your clients with some good default options. The clients are later registered as services.
82
+
You can configure your clients with some good default options. The clients are later registered as services.
82
83
83
84
```yaml
84
85
httplug:
85
-
clients:
86
-
my_guzzle5:
86
+
clients:
87
+
my_guzzle5:
87
88
factory: 'httplug.factory.guzzle5'
88
89
config:
89
-
# These options are given to Guzzle without validation.
90
+
# These options are given to Guzzle without validation.
@@ -134,6 +136,7 @@ Rather than code against specific HTTP clients, you want to use the Httplug `Cli
134
136
135
137
The only steps they need is `require` one of the adapter implementations in their projects `composer.json` and instantiating the HttplugBundle in their kernel.
136
138
139
+
137
140
## Testing
138
141
139
142
``` bash
@@ -143,7 +146,7 @@ $ composer test
143
146
144
147
## Contributing
145
148
146
-
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
149
+
Please see our [contributing guide](http://docs.php-http.org/en/latest/development/contributing.html).
0 commit comments