cfhttpparam

Description

Required for cfhttp POST operations, cfhttpparam is used to specify the parameters necessary to build a cfhttp POST.

Category

Internet Protocol tags

Syntax


<cfhttpparam name = "name"

  type = "type"

  value = "transaction type"

  file = "filename"> 

See also

cfftp, cfhttp, cfldap, cfmail, cfmailparam, cfpop

Attributes

Attribute
Description
name
Required. A variable name for the data being passed.
type
Required. The transaction type. Valid entries are:
  • URL
  • FormField
  • Cookie
  • CGI
  • File
value
Optional for type = "File". Specifies the value of the URL, FormField, Cookie, File, or CGI variable being passed.
file
Required for type = "File".

Example

<!--- This example shows the use of cfhttpparam --->

<html>

<head>

<title>cfhttpparam Example</title>

</head>



<body bgcolor = silver>

<H3>cfhttpparam Example</H3>



<P>This view-only example shows the use of cfhttpparam 

to show the values of passed variables on another HTML

reference, accessed by cfhttp. The other file 

could simply output the value of form.formtest, 

url.url_test, cgi.cgi_test, and

cookie.cookie_test to prove that this page is working:



<H3>Sample Other File Listing</H3>

<cfoutput>#HTMLCodeFormat("

<html>

<head>

<title>Sample Page</title>

</head>

<body>

<H3>Output the passed variables</H3>

<cfoutput>

Form variable: ##form.form_test##

<br>URL variable: ##URL.url_test##

<br>Cookie variable: ##Cookie.cookie_test##

<br>CGI variable: ##CGI.cgi_test##

</cfoutput>

</body>

</html>

")#</cfoutput>



<H3>For cfhttpparam code, see right frame</H3>

<!--- <P>

<cfhttp method = "POST" url = "http://localhost/someotherfile.cfm">

<cfhttpparam name = "form_test" type = "FormField" 

 value = "This is a form variable">

<cfhttpparam name = "url_test" type = "URL" value = "This is a URL variable">

<cfhttpparam name = "cgi_test" type = "CGI" value = "This is a CGI variable">

<cfhttpparam name = "cookie_test" type = "Cookie" value = "This is a cookie">

</cfhttp>



<cfoutput>

    #cfhttp.fileContent#

</cfoutput> --->



</body>

</html>    



Banner.Novgorod.Ru