Module z_url

Misc utility URL functions for zotonic.

Copyright © 2012 Marc Worrell

Authors: Marc Worrell.

Description

Misc utility URL functions for zotonic

Function Index

abs_link/2Given a relative URL and a base URL, calculate the absolute URL.
decode_data_url/1Decode a "data:" url to its parts.
hex_decode/1
hex_encode/1
location/1Find the definitive location of an url, removing url shorteners in the process.
percent_encode/1Percent encoding/decoding as defined by RFC 3986 (http://tools.ietf.org/html/rfc3986).
percent_encode/2
remove_protocol/1Naive function to remove the protocol from an Url.
split_base_host/1
url_decode/1
url_encode/1
url_path_encode/1
url_reserved_char/1
url_unreserved_char/1
url_valid_char/1

Function Details

abs_link/2

abs_link(RelativeUrl::string() | binary(), BaseUrl::string() | binary()) -> binary()

Given a relative URL and a base URL, calculate the absolute URL.

decode_data_url/1

decode_data_url(X1::binary()) -> {ok, Mime::binary(), Charset::binary(), Data::binary()} | {error, unknown_encoding}

Decode a "data:" url to its parts. Crashes if the url doesn't have a "data:" protocol.

hex_decode/1

hex_decode(Data) -> any()

hex_encode/1

hex_encode(Data) -> any()

location/1

location(Url) -> any()

Find the definitive location of an url, removing url shorteners in the process. Identify as Curl to prevent url shorteners returning HTML pages.

percent_encode/1

percent_encode(Chars) -> any()

Percent encoding/decoding as defined by RFC 3986 (http://tools.ietf.org/html/rfc3986).

percent_encode/2

percent_encode(Etc, Encoded) -> any()

remove_protocol/1

remove_protocol(Rest::string() | binary()) -> string() | binary()

Naive function to remove the protocol from an Url

split_base_host/1

split_base_host(Base::string() | binary()) -> {binary(), binary()}

url_decode/1

url_decode(S::string() | binary()) -> binary()

url_encode/1

url_encode(S::string() | atom() | float() | integer() | binary()) -> binary()

url_path_encode/1

url_path_encode(L) -> any()

url_reserved_char/1

url_reserved_char(X1) -> any()

url_unreserved_char/1

url_unreserved_char(Ch) -> any()

url_valid_char/1

url_valid_char(Char) -> any()


Generated by EDoc