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
""
.
Содержание COLDFUSION MX 61-CFML
Страница 1: ...CFML Reference...
Страница 16: ...16 Contents...
Страница 32: ...32 Chapter 1 Reserved Words and Variables...
Страница 123: ...cffile 123 cffile action rename source c files memo keymemo doc destination c files memo oldmemo doc...
Страница 144: ...144 Chapter 2 ColdFusion Tags action close stopOnError Yes p Did it succeed cfoutput cfftp succeeded cfoutput...
Страница 160: ...160 Chapter 2 ColdFusion Tags html...
Страница 186: ...186 Chapter 2 ColdFusion Tags br CGI variable CGI cgi_test br br Note that the CGI variable is URL encoded cfoutput...
Страница 214: ...214 Chapter 2 ColdFusion Tags name sourcedata value Hello world friend cfinvoke cfoutput varName cfoutput...
Страница 245: ...cfmail 245 p input type Submit name form...
Страница 258: ...258 Chapter 2 ColdFusion Tags Example cfobject type corba context ior class c myobject ior name GetName...
Страница 299: ...cfreturn 299 cffunction cfcomponent...
Страница 354: ...354 Chapter 2 ColdFusion Tags cfoutput cfcatch cftry...
Страница 357: ...cfupdate 357 cftable cfif body html...
Страница 362: ...362 Chapter 2 ColdFusion Tags cfloop MyDoc cfxml cfdump var MyDoc...
Страница 397: ...ASin 397 br input type Text name sinNum size 25 p input type Submit name input type RESET form...
Страница 416: ...416 Chapter 3 ColdFusion Functions P INPUT TYPE Submit VALUE Compare these Strings NAME INPUT TYPE RESET FORM...
Страница 418: ...418 Chapter 3 ColdFusion Functions br br input type Submit name nbsp nbsp input type RESET form...
Страница 486: ...486 Chapter 3 ColdFusion Functions input type Submit NAME form...
Страница 492: ...492 Chapter 3 ColdFusion Functions b http_content x content b cfoutput...
Страница 504: ...504 Chapter 3 ColdFusion Functions tr table form...
Страница 519: ...IIf 519 cfoutput b...
Страница 530: ...530 Chapter 3 ColdFusion Functions IsCustomFunction myTestCFCobject testFunc myTestCFCobject testFunc is a function CFIF...
Страница 534: ...534 Chapter 3 ColdFusion Functions input type Submit name form...
Страница 542: ...542 Chapter 3 ColdFusion Functions cfif cfif...
Страница 547: ...IsStruct 547 cfcase cfswitch...
Страница 550: ...550 Chapter 3 ColdFusion Functions IsWDDX returns IsWDDX packet br cfoutput...
Страница 559: ...Left 559 option value 9 9 select input type Submit name Remove characters form...
Страница 565: ...ListContains 565 cfoutput The string two is in b element ListFind aList two b of the list cfoutput...
Страница 608: ...608 Chapter 3 ColdFusion Functions check the current locale for server cfset serverLocale GetLocale...
Страница 620: ...620 Chapter 3 ColdFusion Functions cfoutput cfloop...
Страница 662: ...662 Chapter 3 ColdFusion Functions replacelist stringtoreplace dog brown fox black cow black ferret white cfoutput...
Страница 681: ...SetVariable 681 p Your variable varName p The value of varName is varNameValue cfoutput cfif...
Страница 684: ...684 Chapter 3 ColdFusion Functions br br input type Submit name nbsp nbsp input type RESET form...
Страница 724: ...724 Chapter 3 ColdFusion Functions cfelse h3 Conversion error h3 cfif...
Страница 743: ...XmlNew 743 cfscript cfdump var MyDoc...
Страница 786: ...786 Chapter 5 ColdFusion Java CFX Reference...
Страница 798: ...798 Chapter 6 WDDX JavaScript Objects...
Страница 806: ...806 Chapter 7 ColdFusion ActionScript Functions...