1 Reply Latest reply on Aug 2, 2009 4:38 PM by Ratsnackbar

    CFHTTP Questions


      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 =7815401785&zipCode=02494" resolveurl="Yes" port="443">



      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.

        • 1. Re: CFHTTP Questions
          Ratsnackbar Level 2

          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.