ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# C.41 HttpGetTask This task will download a file through HTTP GET and save it to a specified directory. You need an installed version of [HTTP\_Request2](http://pear.php.net/package/HTTP_Request2) to use this task. Table C.42:聽Attributes NameTypeDescriptionDefaultRequired`url``String`The request URLn/aYes`dir``String`The directory to save the filen/aYes`filename``String`The filename for the downloaded fileThe filename part of the URLNo`followRedirects``Boolean`Whether to follow HTTP redirectsfalseNo`sslVerifyPeer``Boolean`Whether to verify SSL certificatestrueNo`authUser``String`The authentication user namen/aNo`authPassword``String`The authentication passwordn/aNo`authScheme``String`The authentication schemebasicNo`quiet``Boolean`If true, set default log level to Project.MSG\_ERRfalseNo C.41.1 Example `<httpget url="http://buildserver.com/builds/latest.stable.tar.bz2" dir="/usr/local/lib"/>` C.41.2 Supported Nested Tags - `config` Holds additional config data. See [HTTP\_Request2 documentation](http://pear.php.net/manual/en/package.http.http-request2.config.php) for supported values. Table C.43:聽Attributes NameTypeDescriptionDefaultRequired`name``String`Config parameter namen/aYes`value`MixedConfig valuen/aYes - `header` Holds additional header `name` and `value`. Table C.44:聽Attributes NameTypeDescriptionDefaultRequired`name``String`Header namen/aYes`value``String`Header valuen/aYes C.41.3 Global configuration In addition to configuring a particular instance of `HTTP_Request2` via nested `<config>` tags it is also possible to set default configuration values for `HttpGetTask` / `HttpRequestTask` by setting `phing.http.*` properties. ``` <property name="phing.http.proxy" value="socks5://localhost:1080/"/> <!-- This request will go through the default proxy --> <httpget url="http://example.com/file.zip" dir="./"/> <httpget url="http://example.org/file.exe" dir="./"> <!-- This proxy will be used instead of the default one --> <config name="proxy" value="http://foo:bar@proxy.example.org:3128/"/> </httpget> ```