Using The Cf.http Function - MACROMEDIA COLDFUSION MX 61-DEVELOPING COLDFUSION MX Develop Manual

Developing coldfusion mx applications
Table of Contents

Advertisement

The client-side example could look like the following:
#include "NetServices.as"
NetServices.setDefaultGatewayUrl("http://mycfserver:8500");
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)
}

Using the CF.http function

The CF.http function returns an object that contains properties, also known as attributes. You
reference these attributes to access the contents of the file returned, header information, HTTP
status codes, and so on. The following table shows the available properties:
Property
Text
Charset
Header
Filecontent
Mimetype
responseHeader Response header. If there is one instance of a header key, this value can be
664
Chapter 30: Using Server-Side ActionScript
Description
A Boolean value indicating whether the specified URL location contains text
data.
The charset used by the document specified in the URL.
HTTP servers normally provide this information, or the charset is specified in the
charset parameter of the Content-Type header field of the HTTP protocol. For
example, the following HTTP header announces that the character encoding is
EUC-JP:
Content-Type: text/html; charset=EUC-JP
Raw response header. For example, macromedia.com returns the following
header :
HTTP/1.1 200 OK
Date: Mon, 04 Mar 2002 17:27:44 GMT
Server: Apache/1.3.22 (Unix) mod_perl/1.26
Set-Cookie: MM_cookie=207.22.48.162.4731015262864476;
path=/; expires=Wed, 03-Mar-04 17:27:44 GMT;
domain=.macromedia.com
Connection: close
Content-Type: text/html
File contents, for text and MIME files.
MIME type. Examples of MIME types include text/html, image/png, image/gif,
video/mpeg, text/css, and audio/basic.
accessed as a simple type. If there is more than one instance, values are put in an
array in the responseHeader structure.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion mx

Table of Contents