You use the CF.http ActionScript function to retrieve information from a remote HTTP server using HTTP Get and Post methods, as follows:
- Using the Get method, you send information to the remote server directly in the URL. This method is common for a one-way transaction in which the CF.http function retrieves an object, such as the contents of a web page.
- The Post method can pass variables to a form or CGI program, and can also create HTTP cookies.
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. The Get method is the default for the CF.http function.
The following server-side example retrieves file content from the specified URL:
The client-side example could look like the following:
gatewayConnnection = NetServices.createGatewayConnection();
myHttp = gatewayConnnection.getService("httpFuncs", this);
// This is the server-side function invocation
url = "http://anyserver.com";
// Create the results function
url = "http://anyserver.com