I am running ColdFusion 2016 developer edition. I am using cfhttp
to test some settings on a remote Apache web server. Is there a way to set the User Agent? The default seems to be set to ColdFusion
. When I use cfhttpparam
to try to set a new value:
<cfhttpparam type="header" name="user-agent" value="Test UA">
this new value simply gets added and I get:
"ColdFusion, Test UA"
NOTE: I know that the user-agent
header is not a reliable measure to use as it can be changed by the user. However, both my servers are test servers and I'm running tests to help me create some settings on more reliable measures.
As hinted by @KevinB,
cfhttp
has auseragent
attribute which can be used as shown below.Here is what worked:
And the remote server sees:
In
cfscript
I'm able to set it this way:https://cfdocs.org/cfhttp