vibe.d beta banner
get vibe.d
0.10.0

Asynchronous I/O that doesn’t get in your way, written in D

Function download

Downloads a file from the specified URL.

void download(HTTPClient_) (
  URL url,
  scope void delegate(scope InputStream) callback,
  HTTPClient_ client_ = null
);

void download(HTTPClient_) (
  string url,
  scope void delegate(scope InputStream) callback,
  HTTPClient_ client_ = null
);

void download (
  string url,
  string filename
);

void download (
  URL url,
  NativePath filename
);

Any redirects will be followed until the actual file resource is reached or if the redirection limit of 10 is reached. Note that only HTTP(S) is currently supported.

Authors

Sönke Ludwig

Copyright

© 2012-2015 Sönke Ludwig

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.