Adobe COLDFUSION 9 Manual page 1243

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using External Resources
<html>
<head>
<title>HTTP Post Test</title>
</head>
<body>
<h1>HTTP Post Test</h1>
<cfhttp method="Post"
url="http://127.0.0.1:8500/myapps/post_test_server.cfm">
<cfhttpparam type="Cookie"
value="cookiemonster"
name="mycookie6">
<cfhttpparam type="CGI"
value="cgivar "
name="mycgi">
<cfhttpparam type="URL"
value="theurl"
name="myurl">
<cfhttpparam type="Formfield"
value="twriter@adobe.com"
name="emailaddress">
<cfhttpparam type="File"
name="myfile"
file="c:\pix\trees.gif">
</cfhttp>
<cfoutput>
File Content:<br>
#cfhttp.filecontent#<br>
Mime Type:#cfhttp.MimeType#<br>
</cfoutput>
</body>
</html>
Replace the path to the GIF file to a path on your server (just before the closing
2
3
Save the file as post_test.cfm in the myapps directory under your web_root.
Note: Write a page to view the variables, as described in next procedure.
Reviewing the code
The following table describes the code and its function:
Code
<cfhttp method="Post"
url="http://127.0.0.1:8500/myapps/post_test_server
.cfm">
<cfhttpparam type="Cookie" value="cookiemonster"
name="mycookie6">
<cfhttpparam type="CGI" value="cgivar "
name="mycgi">
<cfhttpparam type="URL" value="theurl"
name="myurl">
<cfhttpparam type="Formfield"
value="twriter@adobe.com" name="emailaddress">
Description
Post an HTTP request to the specified page.
Send a cookie in the request.
Send a CGI variable in the request.
Send a URL in the request.
Send a Form field in the request.
Last updated 8/5/2010
tag).
cfhttp
1238

Advertisement

Table of Contents
loading

Table of Contents