Permalink
Fetching contributors…
Cannot retrieve contributors at this time
191 lines (115 sloc) 5.15 KB

Module hackney_url

module to manage urls.

Data Types

qs_vals()


qs_vals() = [{binary(), binary() | true}]

Function Index

fix_path/1
make_url/3 construct an url from a base url, a path and a list of properties to give to the url.
normalize/1Normalizes the encoding of a Url use the hackney_url:pathencode/1 to encode an url.
normalize/2Normalizes the encoding of a Url.
parse_qs/1
parse_url/1Parse an url and return a #hackney_url record.
pathencode/1encode a URL path.
qs/1encode query properties to binary.
transport_scheme/1
unparse_url/1
urldecode/1Decode a URL encoded binary.
urldecode/2Decode a URL encoded binary.
urlencode/1URL encode a string binary.
urlencode/2URL encode a string binary.

Function Details

fix_path/1

fix_path(Path) -> any()

make_url/3


make_url(Url::binary(), Path::binary() | [binary()], Query::binary() | qs_vals()) -> binary()


construct an url from a base url, a path and a list of properties to give to the url.

normalize/1


normalize(URL) -> NormalizedUrl

Normalizes the encoding of a Url use the hackney_url:pathencode/1 to encode an url

normalize/2


normalize(URL, Fun) -> NormalizedUrl

Normalizes the encoding of a Url

parse_qs/1


parse_qs(Bin::binary()) -> qs_vals()


parse_url/1


parse_url(URL::binary() | list()) -> hackney_url()


Parse an url and return a #hackney_url record.

pathencode/1


pathencode(Bin::binary()) -> binary()


Equivalent to pathencode(Bin, []).

encode a URL path

qs/1


qs(KVs::qs_vals()) -> binary()


encode query properties to binary

transport_scheme/1

transport_scheme(X1) -> any()

unparse_url/1

unparse_url(Hackney_url) -> any()

urldecode/1


urldecode(Bin::binary()) -> binary()


Equivalent to urldecode(Bin, crash).

Decode a URL encoded binary.

urldecode/2


urldecode(Bin::binary(), OnError::crash | skip) -> binary()


Decode a URL encoded binary. The second argument specifies how to handle percent characters that are not followed by two valid hex characters. Use skip to ignore such errors, if crash is used the function will fail with the reason badarg.

urlencode/1


urlencode(Bin::binary() | string()) -> binary()


URL encode a string binary.

urlencode/2


urlencode(Bin::binary() | string(), Opts::[noplus | upper]) -> binary()


URL encode a string binary. The noplus option disables the default behaviour of quoting space characters, \s, as +. The upper option overrides the default behaviour of writing hex numbers using lowecase letters to using uppercase letters instead.