Used to retrieve remote content from other websites.
There are two ways to use Url. You can instantiate a new Url, specifying the address and optional configuration properties, and then use the fetch() method to retrieve the remote content. Or you can use the static Url.fetch() method.
| Properties | |
| characterEncoding | Where appropriate, the character set of the resource. |
| contentType | The content type of the retrieved resource. This will just contain the MIME type of the resource, not the character set. |
| headers | The HTTP headers returned from the request. For example:
for (i in url.headers) { out.writeln("Header: " + i); out.writeln("Value: " + url.headers[i]); }
|
| url | The address of the remote resource. A fully qualified URL. |
| Methods | |
| Url.exists(address) | Static method that checks whether the specified remote resource exists. |
| Url.fetch(address) | Static method returning the specified remote resource. Non-text resources such as images are returned as base 64 encoded strings. |
| Url.fetchXml(address) | Static method returning the specified web page as an E4X variable. |
| Url.getResponseCode(address) | Static method that return the HTTP response code for the specified remote resource. |
| fetch() | Retrieve a remote resource. Non-text resources such as images are returned as base 64 encoded strings. |
| fetchXml() | Retrieve a web page as an E4X variable. |