User Guide

cfhttp 179
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.
When ColdFusion receives a response to a
cfhttp request, it can put the response body (if any) in
a file or the
cfhttp.FileContent string variable. If the body text is structured as a result set,
ColdFusion can put the body text in query object. You can also access the values of all returned
headers and specify how to handle error status and redirections, and specify a timeout to prevent
requests from hanging.
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.
Column names must start with a letter. The remaining
characters can be letters, numbers, or underscores (_).
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 "".