From a366623c674e993667fedbe01ad52dc4fab5b4f0 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 15 Mar 2012 11:59:40 +0100 Subject: [inets] The module http_uri now officially supported The module http_uri now officially supported. Also, the http_uri:parse/1,2 function has been extended with more scheme support and a way to provide your own scheme info. OTP-9983 --- lib/inets/doc/src/Makefile | 1 + lib/inets/doc/src/http_uri.xml | 160 +++++++++++++++++++++++++++++++++++++++++ lib/inets/doc/src/notes.xml | 12 ++++ lib/inets/doc/src/ref_man.xml | 9 +-- 4 files changed, 178 insertions(+), 4 deletions(-) create mode 100644 lib/inets/doc/src/http_uri.xml (limited to 'lib/inets/doc') diff --git a/lib/inets/doc/src/Makefile b/lib/inets/doc/src/Makefile index 53d505b102..c4152a1d72 100644 --- a/lib/inets/doc/src/Makefile +++ b/lib/inets/doc/src/Makefile @@ -48,6 +48,7 @@ XML_REF3_FILES = \ inets.xml \ ftp.xml \ tftp.xml \ + http_uri.xml\ httpc.xml\ httpd.xml \ httpd_conf.xml \ diff --git a/lib/inets/doc/src/http_uri.xml b/lib/inets/doc/src/http_uri.xml new file mode 100644 index 0000000000..bd31ae42d2 --- /dev/null +++ b/lib/inets/doc/src/http_uri.xml @@ -0,0 +1,160 @@ + + + + +
+ + 20122012 + Ericsson AB. All Rights Reserved. + + + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights 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()}] + Result = {Scheme, UserInfo, Host, Port, Path, Query} + UserInfo = user_info() + Host = host() + Port = pos_integer() + Path = path() + Query = query() + 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.

+ + +
+
+ + + 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.

+ +
+
+ +
+ + + +
diff --git a/lib/inets/doc/src/notes.xml b/lib/inets/doc/src/notes.xml index f2cd03b6a8..dfdeb4016c 100644 --- a/lib/inets/doc/src/notes.xml +++ b/lib/inets/doc/src/notes.xml @@ -70,6 +70,18 @@

Own Id: OTP-9979

+ +

Utility module + http_uri + now officially supported.

+

Also, the + parse + function has been extended with more + scheme support and a way to provide your own scheme info.

+

Own Id: OTP-9983

+

Aux Id: Seq 12022

+
+ diff --git a/lib/inets/doc/src/ref_man.xml b/lib/inets/doc/src/ref_man.xml index 45d5dfcd0e..e44829827c 100644 --- a/lib/inets/doc/src/ref_man.xml +++ b/lib/inets/doc/src/ref_man.xml @@ -1,10 +1,10 @@ - +
- 19972010 + 19972012 Ericsson AB. All Rights Reserved. @@ -30,8 +30,8 @@

Inets is a container for Internet clients and - servers. Currently a FTP client, a HTTP client and server, and - a tftp client and server has been incorporated in Inets.

+ servers. Currently a FTP client, a HTTP client and server, and + a tftp client and server has been incorporated in Inets.

@@ -45,6 +45,7 @@ +
-- cgit v1.2.3