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.
GetHttpRequestData(includeBody) |
Parameters
Parameter |
Description |
|---|---|
includeBody |
A boolean value specifying whether to retrieve the body of the request. Once it is retrieved, it cannot be read again. The default value of this parameter is true. If you need to retrieve anything other than body from the request, use the parameter value as false. |
The function returns a structure that contains the following entries:
Structure element |
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. |
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()>
|
Sign in to your account