com.adobe.dct.util

# HTTPUtil - AS3 Data Dictionary

Package | com.adobe.dct.util
Class | public class HTTPUtil
Inheritance | HTTPUtil Object

Language Version: | ActionScript 3.0

Product Version: | Data Dictionary Building Block 9.5

Runtime Versions: | AIR (unsupported), Flash Player 10.2

A utility class that is used to obtain an HTTP URL or request related information.

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | HTTPUtil() Constructor. | HTTPUtil
|  | getContext():String [static] Retrieves the context that follows the base of the URL. For example, http://www.adobe.com/snc?x=1&y=2 returns /snc. | HTTPUtil
|  | getHostName():String [static] Retrieves the current host name. For example, http://www.adobe.com/?x=1&y=2 returns www.adobe.com. | HTTPUtil
|  | getParameterValue(key:String):String [static] Retrieves a URL parameter value by name and returns it as a string. | HTTPUtil
|  | getPort():String [static] Retrieves the current port for the URL. | HTTPUtil
|  | getProtocol():String [static] Retrieves the current protocol, such as http: or https:. | HTTPUtil
|  | getUrl():String [static] Retrieves the current URL of the application used to play the SWF file. | HTTPUtil
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Constructor Detail

### HTTPUtil

()
Constructor

`public function HTTPUtil()`

Language Version: | ActionScript 3.0

Product Version: | Data Dictionary Building Block 9.5

Runtime Versions: | AIR (unsupported), Flash Player 10.2

Constructor.

Method Detail

### getContext

()
method

`public static function getContext():String`

Language Version: | ActionScript 3.0

Product Version: | Data Dictionary Building Block 9.5

Runtime Versions: | AIR (unsupported), Flash Player 10.2

Retrieves the context that follows the base of the URL.

For example, `http://www.adobe.com/snc?x=1&y=2` returns `/snc`.

Returns

| `String` — The context that follows the base of the URL.

### getHostName

()
method

`public static function getHostName():String`

Language Version: | ActionScript 3.0

Product Version: | Data Dictionary Building Block 9.5

Runtime Versions: | AIR (unsupported), Flash Player 10.2

Retrieves the current host name.

For example, `http://www.adobe.com/?x=1&y=2` returns www.adobe.com.

Returns

| `String` — The current host name.

### getParameterValue

()
method

`public static function getParameterValue(key:String):String`

Language Version: | ActionScript 3.0

Product Version: | Data Dictionary Building Block 9.5

Runtime Versions: | AIR (unsupported), Flash Player 10.2

Retrieves a URL parameter value by name and returns it as a string. This function works without passing a FlashVars property into the SWF.

For example, even if the URL is `domain.com?MyFlexPage.html?b=5`, it still returns `5` when `'b'` is passed.

This function uses JavaScript to find the URL parameters. Please note, however, that it only works for a GET request. It does not work for a POST request.

Parameters

| `key:String` — the url parameter key

Returns

| `String` — The URL parameter value by name, as a string.

### getPort

()
method

`public static function getPort():String`

Language Version: | ActionScript 3.0

Product Version: | Data Dictionary Building Block 9.5

Runtime Versions: | AIR (unsupported), Flash Player 10.2

Retrieves the current port for the URL.

Returns

| `String` — The current port for the URL.

### getProtocol

()
method

`public static function getProtocol():String`

Language Version: | ActionScript 3.0

Product Version: | Data Dictionary Building Block 9.5

Runtime Versions: | AIR (unsupported), Flash Player 10.2

Retrieves the current protocol, such as `http:` or `https:`.

Returns

| `String` — The current protocol, such as http: or https:.

### getUrl

()
method

`public static function getUrl():String`

Language Version: | ActionScript 3.0

Product Version: | Data Dictionary Building Block 9.5

Runtime Versions: | AIR (unsupported), Flash Player 10.2

Retrieves the current URL of the application used to play the SWF file. For example, Adobe Flash Player.

Returns

| `String` — The current URL of the SWF player.

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00