Copy link to clipboard
Copied
I have what seems like a very simple task.
I need to use cfhhtp to browse a page and save the contents to a file on the server
My code is:
<cfhttp method="GET" url="https://manage.sprintpcs.com/specialoffers/CheckRebate.do?dispatch=checkRebate&phoneNumber=781540178..." resolveurl="Yes" port="443">
</cfhttp>
<cfoutput>#cfhttp.filecontent#</cfoutput>
Seems easy enough... try it... see that the results of the cfhhtp are different than the actual data that gets returned from viewing the url in a browser.
Any ideas?
There HAS to be a way to do this with ColdFusion.
Copy link to clipboard
Copied
When you make a request with CFHTTP the User Agent that is provided to the Web Server at the other end is going to be "ColdFusion" unless you change it to reflect another user agent. It is not uncommon to for developers to check the user agent and then display a different page depending on the results. For example I often provide text only templates to ligit spiders. My Guess is that if you add change the user agent by adding the userAgent parameter property to the cfhttp call and specifying a different common user agent you will get a different result.
-Joe