Be careful when combining this predicate with uri_components/2: if an URI has no query/search component, the following throws an instantiation exception:
uri_components(Uri, uri_components(_, _, _, Query, _), uri_query_components(String, Query),
Did you know ... | Search Documentation: |
Predicate uri_query_components/2 |
?- uri_query_components(QS, [a=b, c('d+w'), n-'VU Amsterdam']). QS = 'a=b&c=d%2Bw&n=VU%20Amsterdam'. ?- uri_query_components('a=b&c=d%2Bw&n=VU%20Amsterdam', Q). Q = [a=b, c='d+w', n='VU Amsterdam'].
Be careful when combining this predicate with uri_components/2: if an URI has no query/search component, the following throws an instantiation exception:
uri_components(Uri, uri_components(_, _, _, Query, _), uri_query_components(String, Query),