Kwang,
Here is the text from the archive, which I have sent you off-list:
============================[ cut here ]========================
ColdFusion custom tag for performing HTTP reads
Copyright 1999 Follett Software Company
The CFHTTP tag that comes as part of ColdFusion is a fine and useful thing,
except that it doesn't allow the user to see response codes or headers. For
anything more than cursory page retrieval (such as building a spider), this
is inadequate.
So we wrote CFX_HTTP, using Visual C++ 5.0.
Parameters
URL
Required. Fully qualified URL to retrieve. It must be an HTTP URL.
UserAgent
Optional. Specifies the User-Agent: HTTP header to be passed to the server.
This header is the name that shows up in the target site's log. This helps
the site know who is visiting their site. For our internal link-checking
spider that we call the WebChimp, the UserAgent parm is "WebChimp/1.0".
Verb
Optional. Specifies the HTTP verb to use (either "GET" or "HEAD"). GET is
assumed if this is omitted.
Timeout
Optional. Specifies the number of seconds to run before timing out on
non-responsive sites. Note: This parm does not work. See "Known Issues"
below.
Accept
Optional. Specifies the MIME type to accept, such as "text/*".
ProxyName
Optional. Specifies the address of the proxy server to use.
ProxyBypass
Optional. Space-separated list of server addresses that should not go
through the proxy. This parm is ignored if ProxyName isn't specified.
UserName
Optional. Username to supply for the connection.
Password
Optional. Password to supply for the connection.
Referer
Optional. Specifies the HTTP_REFERER header, which theoretically tells where
the link to the page came from.
AddlHeaders
Optional. Any additional HTTP headers to pass along.
Example of calling CFX_HTTP
<CFSET URL = "http://www.cnn.com/">
<CFX_HTTP URL="#URL#" USERAGENT="WebChimp/1.0"
PROXYNAME="http://proxy.mycompany.com:8080/"
PROXYBYPASS="intranet.mycompany.com private-machine.mycompany.com">
<CFOUTPUT>
<CFIF CFX_HTTP.ResponseCode EQ 200>
#CFX_HTTP.FileContent#
<CFELSE>
Oops, you got a #CFX_HTTP.ResponseCode# error!
The error message is: "#CFX_HTTP.FileContent#"
</CFIF>
</CFOUTPUT>
Here's an example using POST. Note that you must URLEncode the form data and
concatenate it with the ampersands yourself. CFX_HTTP assumes that it's in a
valid format.
<CFSET URL = "http://www.amazon.com/exec/obidos/generic-quicksearch-query/">
<CFSET FormData = "keyword-query=cold+fusion&mode=books">
<CFX_HTTP URL="#URL#" USERAGENT="#Agent#" VERB="POST" TIMEOUT="10"
FORMDATA="#FormData#">
Using CFX_HTTP's returns
CFX_HTTP creates a one-row query in the caller's namespace called CFX_HTTP.
It's a true query, so you can use something like CFX_DumpQuery to view all
your results. However, you can still refer to the first (only) row in the
query with .Field syntax.
Please note that if CFX_HTTP.ResponseCode is -1, because of a non-HTTP
error, only the CFX_HTTP.FileContent field will have a valid value in it.
All other fields will be undefined, and accessing them through CF tags will
make CF throw an exception. CFX_DumpQuery handles these undefined fields, so
may be a better choice for viewing your responses.
CFX_HTTP.ResponseCode
The 3-digit response code (i.e. 200, 404, 500, etc). If you want a textual
description, you'll have to bust up CFX_HTTP.Headers.
If the response code is -1, then there was some non-HTTP error. For
instance, if the server can't resolve the DNS name for the URL, the response
will be a -1. If so, the textual description of the error will be in
CFX_HTTP.FileContent.
CFX_HTTP.FileContent
This is analogous to CFHTTP.FileContent if the call succeeds, or the error
message in the case of something failing. This field will be blank for a
HEAD call.
CFX_HTTP.URL
Returns the URL that was fetched.
CFX_HTTP.Title
This is the contents of the <TITLE> tag in the returned page. This is to
save you the hassle of parsing the whole page when you only want the title,
as in a web spider. This field will be blank for a HEAD call.
CFX_HTTP.Headers
This is a CRLF-delimited list of all the HTTP headers passed back to your
server.
CFX_HTTP.LastModified
The content of the Last-Modified: header
CFX_HTTP.Date
The content of the Date: header
Known issues
The TIMEOUT= parm does NOT work.
For some reason, CFX_HTTP's overriding of Wininet's default of 45 seconds
for timeouts is ignored. All timeouts will happen after 45 seconds. If
anyone's an expert with WinInet and can help, please contact me at
[EMAIL PROTECTED]
Differences from CFHTTP
No RESOLVEURL parm
This functionality is in the sister tag CFX_ParseHTML. CFHTTP's RESOLVEURL
is slightly buggy as it is. (It prepends servers to javascript: and mailto:
URLs.)
No authentication support
I'm sorry if these shortcomings make CFX_HTTP unsuitable for your purposes.
We wrote it for our needs, and have published it to share. Some of these
features may be made in the future, but it's a low priority.
Revision History
v1.45 Added Referer parm
v1.42 Added UserName and Password parms
v1.41 Added AddlHeader parm
v1.4 Support for POST operations
Support for proxy servers
v1.31 Added progress diagnostics if the DEBUG flag is set.
v1.30 Added seconds and time zone to the time fields.
Added the optional Accept parm.
Fixed a bug where the User-Agent passed was always CFX_HTTP.
v1.28 Used shared MFC DLLs, which should greatly reduce memory usage.
v1.27 Formatted the return code of Last-Modified: and Date: into something
reasonably nice.
v1.26 Add support for Content-Length: and Content-Type: headers
v1.25 Add support for Last-Modified: and Date: headers
v1.1 Fixed problem with caching results.
v1.04 Added URL and Title columns.
v1.03 Fixed bug in handling non-existent domains.
v1.02 Added support for VERB and USERAGENT parms.
v1.00 Initial version
Terms Of Use
CFX_HTTP is Copyright 1999 by Follett Software Company.
You may use CFX_HTTP free of charge. We do not guarantee that it will work
for your specific needs, or even that it will work. If it breaks, you get to
keep both pieces.
We're glad to hear your comments and suggestions, but cannot guarantee that
any improvements will be made. Our business is creating quality software for
libraries and schools, not ColdFusion component development.
No tags from Follett's ColdFusion pages may be redistributed. Please feel
free to link to our pages, but please do not post the tags on your own
pages.
Contacting Us
We welcome and encourage all comments and suggestions about CFX_HTTP, good
and bad. Please contact us at [EMAIL PROTECTED]
The Follett Software Company ColdFusion pages are at
http://www.fsc.follett.com/cf/
============================[ cut here ]========================
Best regards,
Dennis Powers
UXB Internet
(203)879-2844
http://www.uxbinfo.com/
-----Original Message-----
From: Kwang Suh [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 04, 2001 12:03 PM
To: CF-Talk
Subject: CFX_HTTP
Does anyone have the documentation for this tag?
Thanks in advance.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists