M
akes HTTP request headers and body available to CFML pages. Does not take arguments. Returns a ColdFusion structure. GetHttpRequestData
is especially useful for capturing SOAP request data, which can be delivered in an HTTP header.
GetHttpRequestData()
The structure returned by GetHttpRequestData
contains the following entries:
Note Use |
This example code shows how GetHttpRequestData
can be used to 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>