Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

POST request's body

Status
Not open for further replies.

Krogh

Programmer
Aug 16, 2001
22
CH
hi..

i made an http client in java, it's able to send a GET or POST request..
my problem is.. when i send a POST request, i'm not able to get the request's body under CF. The body does not contains formfields or things like that.. just some XML data.
when i dump cgi vars, CGI.CONTENT_LENGTH is the correct length of the request's body, but i can't find any variable containing the body itself.
is there any built-in variable that contains the request made to the server ?

any idea ?

thx for help
 
If you are using cfhttp, you can use #cfhttp.filecontent# to display the cfhttp request. The only dumb questions are the ones that are never asked
 
So you have a java client that makes a POST to a ColdFusion page? Or, as twcman suggests, are you using CFHTTP from within the ColdFusion page to pull content from your java client.

I'm guessing the former.

In theory, you would get at the POSTed content using ColdFusion's #FORM# structure (since, in ColdFusion's mind, it thinks you just submitted a form). The problem is... ColdFusion only processes when a request comes in to serve a page. POST doesn't really make a request to serve a page. So, in short, you can't simply POST to a .CFM page hidden somewhere and have the page process the data. You'd have to POST the data, while at the same time send a request to render the page. Is this what you're doing?

-Carl
 
In fact, i've a JAVA http client.. and i can't put some CF to replace it, cause it works as an Applet on client-side, the CF script on server should be able to read the request containg some XML data.

I finally found the solution, under CF 5, there's the function GetHttpRequestData() that can read the request's body.

thx anyway :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top