• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFHTTP Questions

New Here ,
Jul 28, 2009 Jul 28, 2009

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.

TOPICS
Advanced techniques

Views

684

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 02, 2009 Aug 02, 2009

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation