View comments | RSS feed
Contents > CFML Reference > ColdFusion Functions > GetHttpRequestData PreviousNext

GetHttpRequestData

Makes HTTP request headers and body available to CFML pages. Useful for capturing SOAP request data, which can be delivered in an HTTP header.

A ColdFusion structure.

System functions

GetHttpRequestData()

Parameter

Description

content

Raw content from form submitted by client, in string or binary format. For content to be considered string data, the FORM request header "CONTENT_TYPE" must start with "text/" or be special case "application/x-www-form-urlencoded". Other types are stored as a binary object.

headers

Structure that contains HTTP request headers as value pairs. Includes custom headers, such as SOAP requests.

method

String that contains the CGI variable Request_Method.

protocol

String that contains the Server_Protocol CGI variable.

The structure returned by this function contains the following entries:

Note: To determine whether data is binary, use IsBinary(x.content).To convert data to a string value, if it can be displayed as a string, use toString(x.content).

The following example shows how this function can return HTTP header information.

<cfset x = GetHttpRequestData()>
<cfoutput>
<table cellpadding = "2" cellspacing = "2">
  <tr>
    <td><b>HTTP Request item</b></td>
    <td><b>Value</b></td> </tr>
<cfloop collection = #x.headers# item = "http_item">
    <tr>
      <td>#http_item#</td>
      <td>#StructFind(x.headers, http_item)#</td>   </tr>
</cfloop>
<tr>
   <td>request_method</td>
   <td>#x.method#</td></tr>
<tr>
   <td>server_protocol</td>
   <td>#x.protocol#</td></tr>
</table>
<b>http_content --- #x.content#</b>
</cfoutput>

Contents > CFML Reference > ColdFusion Functions > GetHttpRequestData PreviousNext

ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.

Comments


spage said on Feb 26, 2004 at 9:49 PM :
In the online version of this page, the table of parameters and descriptions appears *ABOVE* the introductory text "The structure returned by this function contains the following entries:" My printed CFMX CFML reference has the table below the introductory text, where it should be..

BTW, all the online reference pages for 6.1 are missing the headings "Description", "Return Value", "Category", "Syntax", "Usage".
jrunrandy said on Mar 11, 2004 at 7:07 AM :
Go to http://www.macromedia.com/support/coldfusion/ts/documents/duplicate_hotfix.htm to get a hot fix for a problem in which getHttpRequestData misinterprets quoted Content-Type headers.
VanPool said on Aug 19, 2005 at 12:57 PM :
GetHttpRequestData() seems to allow receiving of information
from the header and the body.
The LiveDoc show how to see header but not how to see
the information in the body.

Or did I miss the point of this LiveDoc?
gabrielzamp said on Jan 8, 2006 at 2:24 PM :
You should use the tag <cfsavecontent> for taking the generated content of a template.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi97.htm