… | |
… | |
48 | use AnyEvent::Socket (); |
48 | use AnyEvent::Socket (); |
49 | use AnyEvent::Handle (); |
49 | use AnyEvent::Handle (); |
50 | |
50 | |
51 | use base Exporter::; |
51 | use base Exporter::; |
52 | |
52 | |
53 | our $VERSION = '1.41'; |
53 | our $VERSION = '1.42'; |
54 | |
54 | |
55 | our @EXPORT = qw(http_get http_post http_head http_request); |
55 | our @EXPORT = qw(http_get http_post http_head http_request); |
56 | |
56 | |
57 | our $USERAGENT = "Mozilla/5.0 (compatible; U; AnyEvent-HTTP/$VERSION; +http://software.schmorp.de/pkg/AnyEvent)"; |
57 | our $USERAGENT = "Mozilla/5.0 (compatible; U; AnyEvent-HTTP/$VERSION; +http://software.schmorp.de/pkg/AnyEvent)"; |
58 | our $MAX_RECURSE = 10; |
58 | our $MAX_RECURSE = 10; |
… | |
… | |
140 | |
140 | |
141 | The request headers to use. Currently, C<http_request> may provide its |
141 | The request headers to use. Currently, C<http_request> may provide its |
142 | own C<Host:>, C<Content-Length:>, C<Connection:> and C<Cookie:> headers |
142 | own C<Host:>, C<Content-Length:>, C<Connection:> and C<Cookie:> headers |
143 | and will provide defaults for C<User-Agent:> and C<Referer:> (this can be |
143 | and will provide defaults for C<User-Agent:> and C<Referer:> (this can be |
144 | suppressed by using C<undef> for these headers in which case they won't be |
144 | suppressed by using C<undef> for these headers in which case they won't be |
145 | send at all). |
145 | sent at all). |
146 | |
146 | |
147 | =item timeout => $seconds |
147 | =item timeout => $seconds |
148 | |
148 | |
149 | The time-out to use for various stages - each connect attempt will reset |
149 | The time-out to use for various stages - each connect attempt will reset |
150 | the timeout, as will read or write activity. Default timeout is 5 minutes. |
150 | the timeout, as will read or write activity. Default timeout is 5 minutes. |