Module urilib

urilib is a RFC-3986 URI Library for Erlang.

Copyright © 2016

Authors: Gavin M. Roy (gavinmroy@gmail.com).

Description

urilib is a RFC-3986 URI Library for Erlang

Data Types

authority()

authority() = {userinfo(), host(), tcp_port()}

fragment()

fragment() = string() | undefined

host()

host() = string()

password()

password() = string() | undefined

path()

path() = string()

query()

query() = [tuple() | string()] | undefined

scheme()

scheme() = http | https | atom()

tcp_port()

tcp_port() = integer()

uri()

uri() = {scheme(), authority(), path(), query(), fragment()}

url()

url() = 
    {scheme(),
     username(),
     password(),
     host(),
     tcp_port(),
     path(),
     query(),
     fragment()}

userinfo()

userinfo() = {username(), password()} | undefined

username()

username() = string() | undefined

Function Index

build/1Build a URI.
parse/1Parse a URI.
parse/2Parse a URI, returning the result as either a uri() or url().
percent_decode/1Decode a percent encoded string value.
percent_encode/1Percent encode a string value.
plus_decode/1Decode a percent encoded string value that uses pluses for spaces.
plus_encode/1Percent encode a string value similar to encode/1, but encodes spaces with a plus (+) instead of %20.

Function Details

build/1

build(Value :: uri() | url()) -> string()

Build a URI

parse/1

parse(Value :: string()) -> uri()

Parse a URI

parse/2

parse(Value :: string(), Return :: uri | url) -> uri()

Parse a URI, returning the result as either a uri() or url().

percent_decode/1

percent_decode(Value :: string()) -> string()

Decode a percent encoded string value.

percent_encode/1

percent_encode(Value :: string()) -> string()

Percent encode a string value.

plus_decode/1

plus_decode(Value :: string()) -> string()

Decode a percent encoded string value that uses pluses for spaces.

Note: The use of plus for space is defined in RFC-1630 but does not appear in RFC-3986.

plus_encode/1

plus_encode(Value :: string()) -> string()

Percent encode a string value similar to encode/1, but encodes spaces with a plus (+) instead of %20. This function can be used for encoding query arguments.

Note: The use of plus for space is defined in RFC-1630 but does not appear in RFC-3986.


Generated by EDoc, Jan 22 2016, 10:34:52.