URL encoding/decoding

Author(s): The Ciao Development Team.

This module implements URL encoding/decoding predicates.

Usage and interface

Documentation on exports

REGTYPEurl_term/1
A term specifying an Internet Uniform Resource Locator. Currently only HTTP URLs are supported. Example: http('ciao-lang.org',80,"/ciao/"). Defined as
url_term(http(Hostname,Port,URIStr)) :-
        atm(Hostname),
        int(Port),
        string(URIStr).

Usage:url_term(URL)

URL specifies a URL.

    PREDICATEurl_info/2
    url_info(URL,URLTerm)

    Translates a URL URL to a Prolog structure URLTerm which details its various components, and vice-versa. For now non-HTTP URLs make the predicate fail.

    Usage 1:

    • Call and exit should be compatible with:
      (url:url_term/1)URLTerm specifies a URL.
    • The following properties should hold at call time:
      (basic_props:atm/1)URL is an atom.
    • The following properties should hold upon exit:
      (url:url_term/1)URLTerm specifies a URL.

    Usage 2:

    • Call and exit should be compatible with:
      (url:url_term/1)URLTerm specifies a URL.
    • The following properties should hold at call time:
      (basic_props:string/1)URL is a string (a list of character codes).
    • The following properties should hold upon exit:
      (url:url_term/1)URLTerm specifies a URL.

    Usage 3:

    url_info_relative(URL,BaseURLTerm,URLTerm)

    Translates a relative URL URL which appears in the HTML page refered to by BaseURLTerm into URLTerm, a Prolog structure containing its absolute parameters. Absolute URLs are translated as with url_info/2. E.g.

    url_info_relative("dadu.html",
                      http('www.foo.com',80,"/bar/scoob.html"), Info)
    gives Info = http('www.foo.com',80,"/bar/dadu.html").

    Usage 1:

    • Call and exit should be compatible with:
      (url:url_term/1)URLTerm specifies a URL.
    • The following properties should hold at call time:
      (basic_props:atm/1)URL is an atom.
      (url:url_term/1)BaseURLTerm specifies a URL.
    • The following properties should hold upon exit:
      (url:url_term/1)URLTerm specifies a URL.

    Usage 2:

    • Call and exit should be compatible with:
      (url:url_term/1)URLTerm specifies a URL.
    • The following properties should hold at call time:
      (basic_props:string/1)URL is a string (a list of character codes).
      (url:url_term/1)BaseURLTerm specifies a URL.
    • The following properties should hold upon exit:
      (url:url_term/1)URLTerm specifies a URL.

    Documentation on imports

    This module has the following direct dependencies: