URL template
A URL template is a template for URLs that have a common basic structure. The template contains one or more parameters that must be replaced by values in order to obtain a specific URL.
The parameters are usually given in curly brackets, for example {ID}
for a parameter with the name "ID". When constructing a URL, the parameter values used must be URL-encoded , as certain characters such as spaces and question marks cannot be used arbitrarily in a URL. Depending on the application, the URL coding is only necessary for parameters in the query string . In October 2006 the draft of an RFC for URL templates was presented, which was revised several times and approved in a consolidated version in March 2012 as RFC 6570 .
example
The URL template is given http://www.example.org/{type}/?name={name}
with the parameters type
and name
. Assigning the values type=user
and name=Dörte
results in the URL http://www.example.org/user/?name=D%C3%B6rte
.