The CF.http function returns an object that contains properties, also known as attributes, that you reference to access the contents of the file returned, header information, HTTP status codes, and so on. The following table shows the available properties:
In order to pass HTTP Post parameters in the CF.http function, you must construct an array of objects and assign this array to a variable named params. The following arguments can only be passed as an array of objects in the params argument of the CF.http function.
| Parameter |
Description |
|---|---|
| name |
The variable name for data that is passed |
| type |
Transaction type:
|
| value |
Value of URL, FormField, Cookie, File, or CGI variables that are passed |
In the following example, the CF.http function passes HTTP Post parameters in an array of objects.
function postWithParamsAndUser()
{
// Setup the array of post parameters. These are just like cfhttpparam tags.
params = new Array();
params[1] = {name:"arg2", type:"URL", value:"value2"};
url = "http://localhost:8100/";
// Invoke with the method, url, params, username, and password
result = CF.http("post", url, params, "karl", "salsa");
return result.get("Filecontent");
}
ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting
Version 6
Comments are no longer accepted for ColdFusion MX. ColdFusion 8 is the current version.