Bundle Shared networking types used across all HTTP libraries: Url (parsing and construction), Response (status code, headers, body), Cookie, and WebDownloader for streaming downloads. Compile with -lib net.
WebDownloader
Downloads web content
Operations
Download # function
Downloads content for the given URLs
function : Download(urls:Vector<Url>, headers:Map<String,String>) ~ Vector<Pair<Url,ByteArrayRef>>Parameters
| Name | Type | Description |
|---|---|---|
| urls | Vector<Url> | list of URLs to download content from |
| headers | Map<String,String> | key/value headers |
Return
| Type | Description |
|---|---|
| Vector<Pair<Url,ByteArrayRef>> | map of URLs and content |
Example
urls := Vector->New()<Web.HTTP.Url>;
urls->AddBack(Web.HTTP.Url->New("https://example.com/a"));
urls->AddBack(Web.HTTP.Url->New("https://example.com/b"));
results := Web.HTTP.WebDownloader->Download(urls, Nil);
each(result in results) {
result->GetFirst()->GetUrl()->PrintLine();
result->GetSecond()->Get()->Size()->PrintLine();
};