The legacy wiki pages are here for reference purposes only.
For up-to-date information make sure to check the documentation section.

This function can return the value of any of the Server Variables in the current HTTP Request. eg. to get the user agent string of the browser being used to request a page you would use:

<xsl:value-of select="umbraco.library:RequestServerVariables('HTTP_USER_AGENT')"/> 

Example - How to create a fully qualified self referencing link

To create a self referencing URL using the SERVER_NAME server variable:

<a>
<xsl:attribute name="href">
<xsl:text>http://</xsl:text>
<xsl:value-of select="umbraco.library:RequestServerVariables('SERVER_NAME')"/>
<xsl:value-of select="umbraco.library:NiceUrl($currentPage/@id)"/>
</xsl:attribute>
Link Text
</a>

This can also be written as:

<a href="http://{umbraco.library:RequestServerVariables('SERVER_NAME')}{umbraco.library:NiceUrl($currentPage/@id)}">
Link Text
</a>

Using this page as an example, both of the above examples would return:

<a href="http://our.umbraco.org/wiki/reference/umbracolibrary/requestservervariables">
Link Text
</a>

 

 

 

 

Our.umbraco.org is the community mothership for Umbraco, the open source asp.net cms. With a friendly forum for all your questions, a comprehensive documentation and a ton of packages from the community.