Availability::- use_module(library(uri)).
(can be autoloaded)
[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. |