constructor PEAR_REST::PEAR_REST (Previous) (Next) PEAR_REST::getCache

View this page in Last updated: Sun, 28 Sep 2008
English | Dutch | French | German | Hungarian | Japanese | Polish | Plain HTML

PEAR_REST::downloadHttp()

PEAR_REST::downloadHttp()  --  Efficiently Download a file through HTTP. Returns downloaded file as a string in-memory This is best used for small files

Description

If an HTTP proxy has been configured (http_proxy PEAR_Config setting), the proxy will be used.

Parameter

string $url

the URL to download

FALSE|string|array $lastmodified

header values to check against for caching use FALSE to return the header values from this download

FALSE|array $accept

Accept headers to send. This should be a list of MIME types like text/xml, frog/legs, etc.

string $save_dir

directory to save file in

Return value

returns Returns the contents of the downloaded file or a PEAR error on failure. If the error is caused by socket-related errors, the error object will have the fsockopen error code available through getCode(). If caching is requested, then return the header values.

Throws

throws no exceptions thrown

Note

This function can not be called statically.

constructor PEAR_REST::PEAR_REST (Previous) (Next) PEAR_REST::getCache

Download Documentation Last updated: Sun, 28 Sep 2008
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.