mix unicode_idna.download (Unicode IDNA v0.1.0)

View Source

Downloads the Unicode data files required to build Unicode.IDNA.

The destination is Unicode.IDNA.data_dir/0 and the files written are:

  • idna_mapping_table.txt — UTS #46 IDNA mapping table.

  • idna_test_v2.txt — UTS #46 conformance test vectors used by the test suite.

The Bidi_Class and Joining_Type properties consumed by Unicode.IDNA.Bidi and Unicode.IDNA.Context come from the unicode package via Unicode.bidi_class/1 and Unicode.joining_type/1; refresh them with mix unicode.download in that package.

Summary

Functions

Securely download HTTPS content from a URL.

Functions

get(url, options \\ [])

@spec get(String.t(), Keyword.t()) :: {:ok, binary()} | {:error, any()}

Securely download HTTPS content from a URL.

Uses the built-in :httpc client with peer verification enabled.

Arguments

  • url is a binary URL.

  • options is a keyword list of options.

Options

  • :verify_peer — boolean, default true. When false, peer certificate verification is skipped.

  • :timeout — request timeout in milliseconds. Defaults to 120000.

  • :connection_timeout — connection timeout in milliseconds. Defaults to 60000.

Returns

  • {:ok, body} on success.

  • {:error, reason} on failure. An error is also logged.