MACROMEDIA COLDFUSION MX 61-CFML Reference page 181

Cfml reference
Hide thumbs Also See for COLDFUSION MX 61-CFML:
Table of Contents

Advertisement

Building a query from a delimited text file
The
tag can create a ColdFusion query object form the response body. To do so, the
cfhttp
response body must consist of lines of text, with each line having fields that are delimited by a
character that identifies the column breaks. The default delimiter is a comma (,). The response
data can also use a text qualifier; the default is a double quotation mark ("). If you surround a
string field in the text qualifier, the field can contain the delimiter character. To include the text
qualifier in field text, escape it by using a double character. The following line shows a two-line
request body that is converted into a query. It has three comma-delimited fields:
Field1,Field2,Field3
"A comma, in text","A quote: ""Oh My!""",Plain text
Run the following code to show how ColdFusion treats this data:
<cfhttp method="Get"
url="127.0.0.1:8500/tests/escapetest.txt"
name="onerow">
<cfdump var="#onerow#"><br>
Column names can be specified in three ways:
By default, ColdFusion uses the first row of the response as the column names.
If you specify a comma-delimited
the attribute as the column names. Set
response contains data. Otherwise, ColdFusion ignores the first row.
If you do not specify a
generates column names of the form Column_1, Column2, etc.
The
tag checks to ensure that column names in the data returned by the tag start with a
cfhttp
letter and contain only letters, numbers, and underscores (_).
ColdFusion checks for invalid column names. Column names must start with a letter. The
remaining characters can be letters, numbers, or underscores (_). If a column name is not valid,
ColdFusion generates an error.
Notes
For the ColdFusion MX Administrator timeout and the URL timeout to take effect, you must
enable the timeout in the ColdFusion MX Administrator, Server Settings page. For more
information, see Configuring and Administering ColdFusion MX.
The
tag supports Basic Authentication for all operations. However, Basic
cfhttp
Authentication does not work if your web server has Windows NT Challenge/Response
(Microsoft IIS) enabled.
The
tag uses SSL to negotiate secure transactions.
cfhttp
If you put the HTTP response body in a file, ColdFusion does not put it in the
CFHTTP.FileContent variable or generate a query object. If you do not put the response body
in a file, ColdFusion puts it in the CFHTTP.FileContent variable; if you specify a
attribute ColdFusion generates a query object.
The
tag does not support NTLM or Digest Authentication with proxy servers. If a
cfhttp
proxy server requires authentication, it must allow Basic Authentication.
Example
<!--- This example displays the information provided by the Macromedia
Designer & Developer Center XML feed,
attribute, ColdFusion uses the names specified in
columns
firstRowAsHeaders="No"
attribute and set
columns
if the first row of the
firstrowasheaders="No"
, ColdFusion
name
cfhttp
181

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents