Skip to Main Content
Programming ColdFusion MX, 2nd Edition
book

Programming ColdFusion MX, 2nd Edition

by Rob Brooks-Bilson
August 2003
Intermediate to advanced content levelIntermediate to advanced
1140 pages
68h 45m
English
O'Reilly Media, Inc.
Content preview from Programming ColdFusion MX, 2nd Edition

Name

GetHTTPRequestData

Synopsis

                  
                  GetHTTPRequestData( )

Returns a structure containing the HTTP request headers and body available to the current page. This function is especially useful for parsing Simple Object Access Protocol (SOAP) requests, which are often passed in the HTTP header. The structure returned by GetHTTPRequestData( ) contains the following keys:

Headers

Structure containing all the HTTP request headers as key/value pairs.

Content

If the current page is accessed via a form post, Content contains the raw content (string or binary) of the form post; otherwise it is blank. In order to be considered string content, the value of the content_type request header must be “application/x-www-form-urlencoded” or must begin with “text/”. All other content types are automatically stored as binary objects. Because of this, you should first use the IsBinary( ) function when evaluating Content. You may also consider using the ToString( ) function to convert binary data stored in Content to a string value that can then be displayed.

Method

The value contained in the Request_Method CGI variable.

Protocol

The value contained in the Server_Protocol CGI variable.

The following example demonstrates the use of the GetHTTPRequestData( ) function (try calling the template directly and via a form post to see how the Content key is populated differently):

<cfset RequestHeader = GetHttpRequestData( )>
<cfdump var = "#RequestHeader#">
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming ColdFusion

Programming ColdFusion

Rob Brooks-Bilson

Publisher Resources

ISBN: 0596003803Supplemental ContentErrata Page