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
cfhttp to request information from a remote
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
you can with any other ColdFusion variable.
cfhttp.FileContent is only one return variable
made available by the
cfhttp tag. All
cfhttp operations return a structure called
cfhttp that contains information returned by the
target server. Depending on the HTTP operation performed (as defined
method attribute) as well as the response
returned by the target server, the
structure may or may not contain values for the following keys:
Character encoding specified by the response Content-Type header.
In the event of a connection failure, contains details related to the failure. If no failure occurs, this key contains an empty string.
Contains the response body resulting from ...