Solved

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

Posted on 2016-11-30
2
46 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

820 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