View comments | RSS feed

GetHttpRequestData

Description

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

Returns

A ColdFusion structure.

Category

System functions

Function syntax

GetHttpRequestData()

Returns

The function returns a structure containing the following entries:

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.

Usage

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).

Example

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>

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

Version 7

Comments


aminz said on Oct 15, 2005 at 6:54 AM :
Is there a limit on each request header in the http headers?
ASandstrom said on Oct 21, 2005 at 7:48 AM :
The ColdFusion 7.0 server configuration does not have any limit on the request header.

The ColdFusion 7.0.1 server configuration has request header size limitation as follows.
maxHeaderLength 4096
maxUrlLength 2048
maxNoOfHeader 50

When you install ColdFusion in the J2EE configuration, ColdFusion does not set any limit on the request header. However, the underlying application server can limit the request header.

 

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

Current page: http://livedocs.adobe.com/coldfusion/7/htmldocs/00000482.htm