8 library(uri): Process URIs
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • SWI-Prolog C-library
        • library(uri): Process URIs
          • uri_components/2
          • uri_data/3
          • uri_data/4
          • uri_normalized/2
          • iri_normalized/2
          • uri_normalized_iri/2
          • uri_is_global/1
          • uri_resolve/3
          • uri_normalized/3
          • iri_normalized/3
          • uri_normalized_iri/3
          • uri_query_components/2
          • uri_authority_components/2
          • uri_authority_data/3
          • uri_encoded/3
          • uri_iri/2
          • uri_file_name/2
          • uri_edit/3
Availability::- use_module(library(uri)).(can be autoloaded)
Source[det]uri_edit(+Actions, +URI0, -URI)
Modify a URI according to Actions. Actions is either a single action or a (nested) list of actions. Defined primitive actions are:
scheme(+Scheme)
Set the Scheme of the URI (typically http, https, etc.)
user(+User)
Add/set the user of the authority component.
password(+Password)
Add/set the password of the authority component.
host(+Host)
Add/set the host (or ip address) of the authority component.
port(+Port)
Add/set the port of the authority component.
path(+Path)
Set/extend the path component. If Path is not absolute it is taken relative to the path of URI0.
search(+KeyValues)
Extend the Key=Value pairs of the current search (query) component. New values replace existing values. If KeyValues is written as =(KeyValues) the current search component is ignored. KeyValues is a list, whose elements are one of Key=Value, Key-Value or‘Key(Value)`.
fragment(+Fragment)
Set the Fragment of the uri.

Components can be removed by using a variable as value, except from path which can be reset using path(/) and query which can be dropped using query(=([])).

URI0 is either a valid uri or a variable to start fresh.