Solved

Can I evaluate a variable in the value attribute of <cfhttpparam>?

Posted on 2016-11-30
2
28 Views
Last Modified: 2016-11-30
Example:

<cfhttpparam type="header" name="code" value="#URL.code#">

Will this actually evaluate the code from the URL parameter?
0
Comment
Question by:Brian Coughter
2 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 500 total points
ID: 41908048
Yep. There are a few exceptions, but for the most part, any CFML variable within a CF tag (cfquery, cfhttpparam, etc...) will be automatically evaluated.

You can see it in action, by creating two test pages. Run test.cfm and you'll see the value of the header "code" is "Some Value Here"

test.cfm
<cfset url.code = "Some Value Here">
<cfhttp url="http://yourserver.com/action.cfm">
	<cfhttpparam type="header" name="code" value="#URL.code#">
</cfhttp>
<cfoutput>#cfhttp.fileContent#</cfoutput>

Open in new window

action.cfm
<!--- display request data including headers --->
<cfdump var="#GetHttpRequestData()#">

Open in new window

1
 

Author Closing Comment

by:Brian Coughter
ID: 41908067
Thank you
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now