The CF Object

The CF object allows SSAS to perform queries and HTTP calls through the ColdFusion server.

Using CF.http( )

ColdFusion supports the <cfhttp> tag, which allows ColdFusion applications to post to and retrieve content from remote web servers—or from your own web server. The CF.http( ) method mimics the functionality of this tag, as well as its child tag <cfhttpparam>.

Warning

CF.http( ) doesn’t include all of the functionality of the <cfhttp> tag. The ability to dynamically create queries using a .csv file is conspicuously absent from the CF.http( ) arsenal.

CF.http( ) has many possible uses:

  • Post searches and retrieve search results from different search engines

  • Access web services, such as stock services

  • Load XML files from remote locations

  • Create downloadable links that don’t reveal the file location to the end user

  • Dynamically create and save to the server HTML documents that can later be browsed as static pages

There are many more uses as well. CF.http( ) can be called like this:

var myVar = CF.http(method, url, username, password,
                    resolveurl, params, path, file);

The CF.http( ) method accepts up to eight arguments, as listed in Table 6-1.

Table 6-1. Arguments of the CF.http( ) method

Property

Description

method[1]

“get” or “post”. The “get” option retrieves a file, and the “post” option posts data to a server.

url[1]

The URL of the server where you are getting the file or posting the data. This needs to be a fully qualified URL (including the http:// or other protocol). ...

Get Flash Remoting: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.