File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,31 @@ Embed provides a RequestResolvers\Curl class to resolve all requests using the c
7777Embed\Request::setDefaultResolver('MyCustomResolverClass');
7878```
7979
80+ You can configure also the following options of the request resolver:
81+
82+ * user_agent: User agent used in all requests. By default is "Embed PHP Library"
83+ * max_redirections: The maximum amount of HTTP redirections to follow. By default is 20
84+ * connection_timeout: The number of seconds to wait while trying to connect. Use 0 to wait indefinitely. By default is 10
85+ * timeout: The maximum number of seconds to allow execute the request. By default is 10
86+
87+ To set a new configuration:
88+
89+ ``` php
90+ Embed\Request::setResolverConfig(array(
91+ 'user_agent' => 'My spider',
92+ 'connection_timeout' => 0
93+ ));
94+ ```
95+
96+ Or you can set your custom resolver class and the configuration at the same time:
97+
98+ ``` php
99+ Embed\Request::setDefaultResolver('MyCustomResolverClass', array(
100+ 'user_agent' => 'My spider',
101+ 'connection_timeout' => 0
102+ ));
103+ ```
104+
80105
81106Online demo
82107-----------
You can’t perform that action at this time.
0 commit comments