Overview

The CF.http ActionScript function lets you to retrieve information from a remote HTTP server. HTTP Get and Post methods are supported.

Using CF.http to retrieve HTML content

The most basic way to use the CF.http function is to use it with the Get method argument to retrieve a page from a specified URL. For the CF.http function, the Get method is the default.

For example, the following server-side code retrieves file content from the specified URL:

function basicGet(url)
{
  // Invoke with just the url argument. This is an HTTP Get.
  result = CF.http(url);
  return result.get("Filecontent");
}

On the client side, your code could look like the following:

#include "NetServices.as"
NetServices.setDefaultGatewayUrl("http://mycfserver:8100");
gatewayConnnection = NetServices.createGatewayConnection();
myHttp = gatewayConnnection.getService("httpFuncs", this);

// This is the server-side function invocation
url = "http://anyserver.com";
myHttp.basicGet(url);

// Create the results function
function basicGet_result()
{
  url = "http://anyserver.com
  ssasFile.basicGet(url)
}

Comments