
cfhttp
219
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.
The HTTP protocol is the backbone of the World Wide Web and is used for every web
transaction. Because the
cfhttp
tag can generate most types of requests, it provides significant
flexibility. Possible uses include:
•
Interacting with dynamic web sites and services that are not available as web services. (Use the
the
cfinvoke
tag to access SOAP web services.)
•
Getting the contents of an HTML page or other file such as an image on a web server for use
in your CFML page or storage in a file.
•
Sending a secure request to a server by specifying the https protocol in the
url
attribute.
•
Using the POST method to send a multipart/form-data style post to any URL that can handle
such data and return results, including CGI executables or even other ColdFusion pages.
•
Using the PUT method to upload files to a server that does not accept FTP requests.
This tag can, and for PUT and POST requests must, have a body that contains
cfhttpparam
tags. If this tag has
cfhttpparam
tags, it must have a
</cfhttp>
end tag.
To use HTTPS with the
cfhttp
tag, you might need to manually import the certificate for each
web server into the keystore for the JRE that ColdFusion uses. This procedure should not be
necessary if the certificate is signed (issued) by an authority that the JSSE (Java Secure Sockets
Extension) recognizes (for example, Verisign); that is, if the signing authority is in the cacerts
already. However, you might need to use the procedure if you are issuing SSL (secure sockets
layer) certificates yourself.
To manually import a certificate:
1.
Go to a page on the SSL server in question.
2.
Double-click the lock icon.
3.
Click the Details tab.
4.
Click Copy To File.
5.
Select the base64 option and save the file.
6.
Copy the CER file into C:\CFusionMX7\runtime\jre\lib\security (or whichever JRE
ColdFusion is using).
7.
Run the following command in the same directory (keytool.exe is located in
C:\CFusionMX7\runtime\jre\bin):
keytool -import -keystore cacerts -alias giveUniqueName -file filename.cer
Содержание COLFUSION MX 7-CFML
Страница 1: ...COLDFUSION MX7 CFML Reference...
Страница 20: ...20 Chapter 1 Reserved Words and Variables...
Страница 50: ...50 Chapter 2 ColdFusion Tags cfelse br Searching cfif cfloop cfif...
Страница 101: ...cfdefaultcase 101 cfdefaultcase cfswitch cfoutput Your grade is grade cfoutput...
Страница 115: ...cfdocumentsection 115 cfdocumentsection cfoutput cfdocument...
Страница 311: ...cfNTauthenticate 311 Please Try again H2 cfif cfoutput cfinclude template loginform cfm cfabort cfif cfif cflogin...
Страница 411: ...cftable 411 cftable body html...
Страница 515: ...Chr 515 maxlength 5 p input type Submit name input type RESET cfform...
Страница 605: ...GetEncoding 605 WriteOutput The encoding is theEncoding cfscript cfif...
Страница 629: ...GetProfileString 629 tr td input type Submit name Submit value Submit td td td tr table form...
Страница 655: ...IIf 655 cfoutput IIf Hour Now GTE 12 DE It is afternoon or evening DE It is morning cfoutput b...
Страница 664: ...664 Chapter 3 ColdFusion Functions cfelse h3 Conversion error h3 cfif...
Страница 687: ...IsStruct 687 cfoutput cfquery cfif cfoutput hr Employee Add Complete cfoutput cfcase cfswitch...
Страница 693: ...IsWDDX 693 struct data wddxPacket hr xmp cfoutput packet xmp IsWDDX returns IsWDDX packet br cfoutput...
Страница 751: ...LSDateFormat 751 hr noshade cfoutput cfloop...
Страница 861: ...StructFind 861 cfquery cfif cfoutput hr Employee Add Complete cfoutput cfcase cfswitch...
Страница 869: ...StructIsEmpty 869 cfoutput cfquery cfif cfoutput hr Employee Add Complete cfoutput cfcase cfswitch...
Страница 903: ...Val 903 value Is the beginning numeric name form...
Страница 932: ...932 Chapter 3 ColdFusion Functions...
Страница 944: ...944 Chapter 4 ColdFusion MX Flash Form Style Reference...
Страница 962: ...962 Chapter 5 Application CFC Reference...
Страница 1008: ...1008 Chapter 6 ColdFusion MX Event Gateway Reference cfset retValue Reason reason cfreturn retValue cffunction...
Страница 1054: ...1054 Chapter 6 ColdFusion MX Event Gateway Reference...