• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

14.1. Retrieving Information

CFHTTP uses the HTTP GET method to initiate a one-way request for information from a remote server. The transaction mimics the one that a standard web browser uses to request a web page. The only difference is that in the case of CFHTTP, the requested page is stored in a ColdFusion variable or in a query object, as opposed to being displayed in the user's browser. Let's look at the different ways in which you can use CFHTTP to request information from a remote server.

14.1.1. Saving Information to a Variable

In its most simplistic form, CFHTTP can grab an entire file (either plain text or HTML) and store it in a single variable called CFHTTP.FileContent. You can access and manipulate the information stored in CFHTTP.FileContent as you can with any other ColdFusion variable. The following example illustrates how to use CFHTTP to retrieve a remote web page and store it as a variable:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint