Download

Downloads from HTTP and outputs the results as new documents.
The original input documents are ignored and are not part of the output of this module. If you want to retain the original input documents, consider using the Wyam.Core.Modules.Control.ConcatBranch module.

Usage

  • Download(string uri, RequestHeaders headers)

    Downloads the specified URI with the specified request header.

    • uri

      The URI to download.

    • headers

      The request header to use.

  • Download(params string[] uris)

    Downloads the specified URIs with a default request header.

    • uris

      The URIs to download.

Fluent Methods

Chain these methods together after the constructor to modify behavior.

  • CacheResponses(bool cacheResponses = true)

    Indicates whether the downloaded response should be cached between regenerations.

    • cacheResponses

      If set to true, the response is cached (the default is false).

  • WithRequests(params DownloadRequest[] requests)

    Downloads the specified requests.

    • requests

      The requests to download.

  • WithUri(string uri, RequestHeaders headers = null)

    Downloads the specified URI with the specified request header.

    • uri

      The URI to download.

    • headers

      The request header to use.

  • WithUris(params string[] uris)

    Downloads the specified URIs with a default request header.

    • uris

      The URIs to download.

Output Metadata

The metadata values listed below apply to individual documents and are created and set by the module as indicated in their descriptions.

  • Keys.SourceHeaders: Dictionary<string, string>

    The web headers of the document.

  • Keys.SourceUri: System.String

    The URI where the document was downloaded from.

GitHub