--- AnyEvent-HTTP/README 2011/01/12 03:30:05 1.17 +++ AnyEvent-HTTP/README 2011/07/27 16:11:55 1.22 @@ -123,6 +123,9 @@ if the default AnyEvent string gets blocked by webservers sooner or later. + Also, make sure that your headers names and values do not + contain any embedded newlines. + timeout => $seconds The time-out to use for various stages - each connect attempt will reset the timeout, as will read or write activity, i.e. @@ -131,12 +134,14 @@ Default timeout is 5 minutes. proxy => [$host, $port[, $scheme]] or undef - Use the given http proxy for all requests. If not specified, - then the default proxy (as specified by $ENV{http_proxy}) is - used. + Use the given http proxy for all requests, or no proxy if + "undef" is used. $scheme must be either missing or must be "http" for HTTP. + If not specified, then the default proxy is used (see + "AnyEvent::HTTP::set_proxy"). + body => $string The request body, usually empty. Will be sent as-is (future versions of this module might offer more options). @@ -333,7 +338,7 @@ timeout of 30 seconds. http_request - GET => "https://www.google.com", + HEAD => "https://www.google.com", headers => { "user-agent" => "MySearchClient 1.0" }, timeout => 30, sub { @@ -368,6 +373,10 @@ To clear an already-set proxy, use "undef". + When AnyEvent::HTTP is laoded for the first time it will query the + default proxy from the operating system, currently by looking at + "$ENV{http_proxy"}. + AnyEvent::HTTP::cookie_jar_expire $jar[, $session_end] Remove all cookies from the cookie jar that have been expired. If $session_end is given and true, then additionally remove all session @@ -458,8 +467,8 @@ snippets. HTTP/1.1 FILE DOWNLOAD - Downloading files with HTTP cna be quite tricky, especially when - something goes wrong and you want tor esume. + Downloading files with HTTP can be quite tricky, especially when + something goes wrong and you want to resume. Here is a function that initiates and resumes a download. It uses the last modified time to check for file content changes, and works with @@ -485,7 +494,7 @@ warn -s _; if (stat $fh and -s _) { $ofs = -s _; - warn "-s is ", $ofs;#d# + warn "-s is ", $ofs; $hdr{"if-unmodified-since"} = AnyEvent::HTTP::format_date +(stat _)[9]; $hdr{"range"} = "bytes=$ofs-"; }