.TH http_uri 3erl "inets 5.9" "Ericsson AB" "Erlang Module Definition" .SH NAME http_uri \- URI utility module .SH DESCRIPTION .LP This module provides utility functions for working with URIs, according to RFC 3986\&. .SH "COMMON DATA TYPES " .LP Type definitions that are used more than once in this module: .LP .nf boolean() = true | false string() = list of ASCII characters .fi .SH "URI DATA TYPES " .LP Type definitions that are related to URI: .LP For more information about URI, see RFC 3986\&. .LP .nf uri() = string() - Syntax according to the URI definition in rfc 3986, ex: "http://www.erlang.org/" user_info() = string() scheme() = atom() - Example: http, https host() = string() port() = pos_integer() path() = string() - Representing a file path or directory path query() = string() .fi .SH EXPORTS .LP .B scheme_defaults() -> SchemeDefaults .br .RS .LP Types: .RS 3 SchemeDefaults = [{scheme(), default_scheme_port_number()}] .br default_scheme_port_number() = pos_integer() .br .RE .RE .RS .LP This function provides a list of the scheme and their default port numbers currently supported (by default) by this utility\&. .RE .LP .B parse(URI) -> {ok, Result} | {error, Reason} .br .B parse(URI, Options) -> {ok, Result} | {error, Reason} .br .RS .LP Types: .RS 3 URI = uri() .br Options = [Option] .br Option = {ipv6_host_with_brackets, boolean()} | {scheme_defaults, scheme_defaults()}] .br Result = {Scheme, UserInfo, Host, Port, Path, Query} .br UserInfo = user_info() .br Host = host() .br Port = pos_integer() .br Path = path() .br Query = query() .br Reason = term() .br .RE .RE .RS .LP This function is used to parse an URI\&. If no scheme defaults are provided, the value of \fBscheme_defaults\fR\& function will be used\&. .LP Note that when parsing an URI with an unknown scheme (that is, a scheme not found in the scheme defaults) a port number must be provided or else the parsing will fail\&. .RE .LP .B encode(URI) -> HexEncodedURI .br .RS .LP Types: .RS 3 URI = uri() .br HexEncodedURI = string() - Hex encoded uri .br .RE .RE .RS .LP Hex encode an URI\&. .RE .LP .B decode(HexEncodedURI) -> URI .br .RS .LP Types: .RS 3 HexEncodedURI = string() - A possibly hex encoded uri .br URI = uri() .br .RE .RE .RS .LP Decode a possibly hex encoded URI\&. .RE