User Guide
218 Chapter 2: ColdFusion Tags
The following attributes tell ColdFusion to convert the HTTP response body into a ColdFusion
query object. They can be used with the GET and POST methods only.
Usage
The cfhttp tag is a general-purpose tool for creating HTTP requests and handling the returned
results. It enables you to generate most standard HTTP request types. You use embedded
cfhttpparam tags to specify request headers and body content.
Attribute Req/Opt Default Description
name Opt Tells ColdFusion to create a query object with the given
name from the returned HTTP response body.
columns Opt First row of
response
contains
column
names.
The column names for the query, separated by commas,
with no spaces. Column names must start with a letter. The
remaining characters can be letters, numbers, or
underscore characters (_).
If there are no column name headers in the response,
specify this attribute to identify the column names.
If you specify this attribute, and the
firstrowasHeader
attribute is True (the default), the column names specified
by this attribute replace the first line of the response. You
can use this behavior to replace the column names retrieved
by the request with your own names.
If a duplicate column heading is encountered in either this
attribute or in the column names from the response,
ColdFusion appends an underscore to the name to make it
unique.
If the number of columns specified by this attribute does not
equal the number of columns in the HTTP response body,
ColdFusion generates an error.
firstrowas
headers
Opt yes Determines how ColdFusion processes the first row of the
query record set:
• yes: processes the first row as column heads. If you
specify a
columns attribute, ColdFusion ignores the first
row of the file.
• no: processes the first row as data. If you do not specify a
columns attribute, ColdFusion generates column names
by appending numbers to the word "column"; for example,
"column_1".
delimiter Opt , [comma] A character that separates query columns. The response
body must use this character to separate the query
columns.
textQualifier Opt " [double-
quotation
mark]
A character that, optionally, specifies the start and end of a
text column. This character must surround any text fields in
the response body that contain the delimiter character as
part of the field value.
To include this character in column text, escape it by using
two characters in place of one. For example, if the qualifier
is a double-quotation mark, escape it as "".