20122013 Ericsson AB. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. http_uri
http_uri URI utility module

This module provides utility functions for working with URIs, according to RFC 3986.

COMMON DATA TYPES

Type definitions that are used more than once in this module:

URI DATA TYPES

Type definitions that are related to URI:

For more information about URI, see RFC 3986.

scheme_defaults() -> SchemeDefaults A list of scheme and their default ports SchemeDefaults = [{scheme(), default_scheme_port_number()}] default_scheme_port_number() = pos_integer()

This function provides a list of the scheme and their default port numbers currently supported (by default) by this utility.

parse(URI) -> {ok, Result} | {error, Reason} parse(URI, Options) -> {ok, Result} | {error, Reason} Parse an URI URI = uri() Options = [Option] Option = {ipv6_host_with_brackets, boolean()} | {scheme_defaults, scheme_defaults()} | {fragment, boolean()}] Result = {Scheme, UserInfo, Host, Port, Path, Query} | {Scheme, UserInfo, Host, Port, Path, Query, Fragment} UserInfo = user_info() Host = host() Port = pos_integer() Path = path() Query = query() Fragment = fragment() Reason = term()

This function is used to parse an URI. If no scheme defaults are provided, the value of scheme_defaults function will be used.

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.

If the fragment option is true, the URI fragment will be returned as part of the parsing result, otherwise it is completely ignored.

encode(URI) -> HexEncodedURI Hex encode an URI URI = uri() HexEncodedURI = string() - Hex encoded uri

Hex encode an URI.

decode(HexEncodedURI) -> URI Decode a hex encoded URI HexEncodedURI = string() - A possibly hex encoded uri URI = uri()

Decode a possibly hex encoded URI.