From 27cfa1da6d35674f6cd169b103385a09c8d4c55a Mon Sep 17 00:00:00 2001 From: Luca Favatella Date: Thu, 22 Feb 2018 20:14:18 +0000 Subject: inets: export types documented for http_uri module Also: * Reuse type `inet:port_number()` in `http_uri` code and doc; * Do not imply that http_uri module can properly handle UTF-8 encoded binaries, while it can't. * Enrich function specifications in http_uri module; * Fix http_uri doc re missing type definition for `Scheme`. --- lib/inets/doc/src/http_uri.xml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'lib/inets/doc') diff --git a/lib/inets/doc/src/http_uri.xml b/lib/inets/doc/src/http_uri.xml index 20c042c202..97be292d87 100644 --- a/lib/inets/doc/src/http_uri.xml +++ b/lib/inets/doc/src/http_uri.xml @@ -45,7 +45,6 @@ this module:

boolean() = true | false

string() = list of ASCII characters

-

unicode_binary() = binary() with characters encoded in the UTF-8 coding standard

@@ -54,22 +53,22 @@

Type definitions that are related to URI:

- uri() = string() | unicode:unicode_binary() + uri() = string() | binary()

Syntax according to the URI definition in RFC 3986, for example, "http://www.erlang.org/"

- user_info() = string() | unicode:unicode_binary() + user_info() = string() | binary()

scheme() = atom()

Example: http, https

- host() = string() | unicode:unicode_binary() + host() = string() | binary()

- port() = pos_integer() + port() = inet:port_number()

- path() = string() | unicode:unicode_binary() + path() = string() | binary()

Represents a file path or directory path

- query() = string() | unicode:unicode_binary() + query() = string() | binary()

- fragment() = string() | unicode:unicode_binary() + fragment() = string() | binary()

@@ -84,7 +83,7 @@ Decodes a hexadecimal encoded URI. - HexEncodedURI = string() | unicode:unicode_binary() - A possibly hexadecimal encoded URI + HexEncodedURI = string() | binary() - A possibly hexadecimal encoded URI URI = uri() @@ -99,7 +98,7 @@ Encodes a hexadecimal encoded URI. URI = uri() - HexEncodedURI = string() | unicode:unicode_binary() - Hexadecimal encoded URI + HexEncodedURI = string() | binary() - Hexadecimal encoded URI @@ -122,9 +121,10 @@ {scheme_validation_fun, fun()}] Result = {Scheme, UserInfo, Host, Port, Path, Query} | {Scheme, UserInfo, Host, Port, Path, Query, Fragment} + Scheme = scheme() UserInfo = user_info() Host = host() - Port = pos_integer() + Port = inet:port_number() Path = path() Query = query() Fragment = fragment() @@ -146,7 +146,7 @@

Scheme validation fun is to be defined as follows:

-fun(SchemeStr :: string() | unicode:unicode_binary()) -> +fun(SchemeStr :: string() | binary()) -> valid | {error, Reason :: term()}. @@ -162,7 +162,7 @@ fun(SchemeStr :: string() | unicode:unicode_binary()) -> A list of the scheme and their default ports. SchemeDefaults = [{scheme(), default_scheme_port_number()}] - default_scheme_port_number() = pos_integer() + default_scheme_port_number() = inet:port_number()

Provides a list of the scheme and their default -- cgit v1.2.3