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,
Contentcontains the raw content (string or binary) of the form post; otherwise it is blank. In order to be considered string content, the value of thecontent_typerequest 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 theIsBinary( )function when evaluatingContent. You may also consider using theToString( )function to convert binary data stored inContentto a string value that can then be displayed.-
Method The value contained in the
Request_MethodCGI variable.-
Protocol The value contained in the
Server_ProtocolCGI 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#">