urilib/README.md
2016-01-08 23:27:38 -05:00

3.5 KiB

urilib

RFC-3986 URI Library for Erlang.

Build Status codecov.io

API

Function Index

build/1Returns a URI from the record passed in.
decode/1Decode a percent encoded string value.
decode_plus/1Decode a percent encoded string value that uses pluses for spaces.
encode/1Percent encode a string value.
encode_plus/1Percent encode a string value similar to encode/1, but encodes spaces with a plus (+) instead of %20.
parse_uri/1Parse a URI string returning the parsed data as a record.
parse_url/1Parse a URL string returning the parsed data as a record.

Function Details

build/1


build(Uri::Value) -> URI
  • Value = #uri{} | #url{}
  • URI = string()

Returns a URI from the record passed in.

decode/1


decode(Value) -> DecodedValue
  • Value = string()
  • DecodeValue = string()

Decode a percent encoded string value.

decode_plus/1


decode_plus(Value) -> DecodedValue
  • Value = string()
  • DecodeValue = 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.

encode/1


encode(Value) -> EncodedValue
  • Value = string()
  • EncodedValue = string()

Percent encode a string value.

encode_plus/1


encode_plus(Value) -> EncodedValue
  • Value = string()
  • EncodedValue = 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.

parse_uri/1


parse_uri(URI) -> ParsedURI
  • URI = string()
  • ParsedURI = #uri{}

Parse a URI string returning the parsed data as a record

parse_url/1


parse_url(URL) -> ParsedURL
  • URI = string()
  • ParsedURL = #url{}

Parse a URL string returning the parsed data as a record