User Guide

Table Of Contents
Using the CF.http function 839
url = "http://localhost:8500/";
// Invoke CF.http with the method, url, and params
result = CF.http("post", url, params);
return result.get("Filecontent");
}
Using the CF.http Get method
You use the
Get method to retrieve files, including text and binary files, from a specified server.
You reference properties of the object returned by the
CF.http function to access things like file
content, header information, MIME type, and so on.
The following example uses the
CF.http function to show a common approach to retrieving data
from the web:
// Returns content of URL defined in url variable
// This example uses positional argument style
function get()
{
url = "http://www.macromedia.com/software/coldfusion/";
//Invoke with just the url argument. Get is the default.
result = CF.http(url);
return result.get("Filecontent");
}
For more information about CF.http function properties, see CF.http in CFML Reference.