… | |
… | |
95 | and "Referer:" (this can be suppressed by using "undef" for |
95 | and "Referer:" (this can be suppressed by using "undef" for |
96 | these headers in which case they won't be sent at all). |
96 | these headers in which case they won't be sent at all). |
97 | |
97 | |
98 | timeout => $seconds |
98 | timeout => $seconds |
99 | The time-out to use for various stages - each connect attempt |
99 | The time-out to use for various stages - each connect attempt |
100 | will reset the timeout, as will read or write activity. Default |
100 | will reset the timeout, as will read or write activity, i.e. |
|
|
101 | this is not an overall timeout. |
|
|
102 | |
101 | timeout is 5 minutes. |
103 | Default timeout is 5 minutes. |
102 | |
104 | |
103 | proxy => [$host, $port[, $scheme]] or undef |
105 | proxy => [$host, $port[, $scheme]] or undef |
104 | Use the given http proxy for all requests. If not specified, |
106 | Use the given http proxy for all requests. If not specified, |
105 | then the default proxy (as specified by $ENV{http_proxy}) is |
107 | then the default proxy (as specified by $ENV{http_proxy}) is |
106 | used. |
108 | used. |
… | |
… | |
137 | predefined low-security (no verification, highest compatibility) |
139 | predefined low-security (no verification, highest compatibility) |
138 | and high-security (CA and common-name verification) TLS context. |
140 | and high-security (CA and common-name verification) TLS context. |
139 | |
141 | |
140 | The default for this option is "low", which could be interpreted |
142 | The default for this option is "low", which could be interpreted |
141 | as "give me the page, no matter what". |
143 | as "give me the page, no matter what". |
|
|
144 | |
|
|
145 | on_prepare => $callback->($fh) |
|
|
146 | In rare cases you need to "tune" the socket before it is used to |
|
|
147 | connect (for exmaple, to bind it on a given IP address). This |
|
|
148 | parameter overrides the prepare callback passed to |
|
|
149 | "AnyEvent::Socket::tcp_connect" and behaves exactly the same way |
|
|
150 | (e.g. it has to provide a timeout). See the description for the |
|
|
151 | $prepare_cb argument of "AnyEvent::Socket::tcp_connect" for |
|
|
152 | details. |
142 | |
153 | |
143 | on_header => $callback->($headers) |
154 | on_header => $callback->($headers) |
144 | When specified, this callback will be called with the header |
155 | When specified, this callback will be called with the header |
145 | hash as soon as headers have been successfully received from the |
156 | hash as soon as headers have been successfully received from the |
146 | remote server (not on locally-generated errors). |
157 | remote server (not on locally-generated errors). |
… | |
… | |
236 | undef $request; |
247 | undef $request; |
237 | |
248 | |
238 | GLOBAL FUNCTIONS AND VARIABLES |
249 | GLOBAL FUNCTIONS AND VARIABLES |
239 | AnyEvent::HTTP::set_proxy "proxy-url" |
250 | AnyEvent::HTTP::set_proxy "proxy-url" |
240 | Sets the default proxy server to use. The proxy-url must begin with |
251 | Sets the default proxy server to use. The proxy-url must begin with |
241 | a string of the form "http://host:port" (optionally "https:..."). |
252 | a string of the form "http://host:port" (optionally "https:..."), |
|
|
253 | croaks otherwise. |
|
|
254 | |
|
|
255 | To clear an already-set proxy, use "undef". |
242 | |
256 | |
243 | $AnyEvent::HTTP::MAX_RECURSE |
257 | $AnyEvent::HTTP::MAX_RECURSE |
244 | The default value for the "recurse" request parameter (default: 10). |
258 | The default value for the "recurse" request parameter (default: 10). |
245 | |
259 | |
246 | $AnyEvent::HTTP::USERAGENT |
260 | $AnyEvent::HTTP::USERAGENT |