Skip to main content
Skip table of contents

HTTP functions

Overview

HTTP functions encode and decode uniform resource identifiers (URLS) and their components.

UrlDecode

Returns text, encoded as uniform resource locator (URL).

Syntax

UrlDecode ( text )

The required argument text must be of type Text.

Remarks

This function translates a text string encoded according to the percent encoding rules into a uniform resource locator (URL). It is the inverse of the UrlEncode function.

Example

The expression http://something.com/my%20stuff/your%2Fstuff returns http://something.com/my stuff/your/stuff.

UrlEncode

Returns text, encoded as uniform resource identifier (URL).

Syntax

UrlEncode ( text )

The required argument text must be of type Text.

Remarks

This function encodes a text string according to the percent encoding rules described at http://en.wikipedia.org/wiki/Percent_encoding. Use this function to encode elements of the path part of a URL not including the / character. Use UrlPathEncode to encode the entire path including the / characters. 

Example

The expression "http://something.com/" + UrlEncode("my stuff") + "/" + UrlEncode("your/stuff") returns http://something.com/my%20stuff/your%2Fstuff.

UrlEncodeArguments

Encodes name/value pairs to conform with POST request method.

Syntax

UrlEncodeArguments ( name, value [, name, value ...] )

The required arguments name and value must be of type Text.

Remarks

This function encodes name/value pairs according to the POST form encoding rules described at http://en.wikipedia.org/wiki/POST_(HTTP). Use this function to encode the query component of a URL. 

Example

The expression "http://something.com/search?" + UrlEncodeArguments("name", "john smith", "limit", "10") returns http://something.com/search?name=john+smith&limit=10.

UrlPathEncode

Returns text, encoded as uniform resource identifier (URL), but with the slash character intact.

Syntax

UrlPathEncode ( text )

The required argument text must be of type Text.

Remarks

This function encodes a text string according to the percent encoding rules described at http://en.wikipedia.org/wiki/Percent_encoding, except it does not encode the “/” characters. Use this function to encode the path component of a URL. 

Example

The expression "http://something.com/" + UrlPathEncode("my stuff/your/stuff") returns http://something.com/my%20stuff/your/stuff.

UrlQueryEncode

Returns text, encoded as uniform resource identifier (URL) but with query components

Syntax

UrlQueryEncode ( text )

The required argument text must be of type Text.

Remarks

This function encodes a text string according to the percent encoding rules described at http://en.wikipedia.org/wiki/Percent_encoding, except it encodes space characters as + instead of %20. Use this function to encode individual elements of the query component of a URL. 

To encode a complete set of name/value pairs in a query part, use the function UrlEncodeArguments instead.

Example

The expression "http://something.com/search?name=" + UrlQueryEncode("john smith, jr.") returns http://something.com/search?name=john+smith%2C+jr..

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.