Skip to main content
June 3, 2009
Question

CFHTTP Post is doing a second GET request right after

  • June 3, 2009
  • 2 replies
  • 814 views

I'm doing a CFHTTP Post to a remote server.  The remote site has looked at their logs and they say my code is doing the POST, and then immediately doing a 2nd GET request.

I am using CF8.    Here is my code (the URL has been changed):

<cfhttp url="https://www.theurlofthesite.com" method="POST" port="443" resolveurl="yes" redirect="yes">
<cfhttpparam type="FORMFIELD" name="type" value="SALES">
<cfhttpparam type="FORMFIELD" name="account" value="10003">
<cfhttpparam type="FORMFIELD" name="Submit" value="Submit+Request">
</cfhttp>

<Cfoutput>#cfhttp.fileContent#</CFOUTPUT>

<cfdump var="#cfhttp#">

Does anyone have any idea why they are seeing a 2nd GET request right after my POST?    it's trashing the session and not returing the page correctly because of this (we think)

I'm definately not doing a GET, I'm only doing the one POST.

thanks,

Rich

This topic has been closed for replies.

2 replies

June 4, 2009

ok, I switched to a CF5 server and the 2nd GET stopped.  so it looks like a quirk of CF8

Participating Frequently
June 4, 2009

I would investigate the problem further because I worked pretty

extensively with CFHTTP and I didn't encounter that behavior.

Mack

Participating Frequently
June 4, 2009

I think the remote server responds with a redirect message (302) and

CF follows that redirect. You can check this by having redirect="no"

and throwonerror="no" in your CFHTTP and cfdumping the response.

Mack

BKBK
Community Expert
Community Expert
June 6, 2009
ok, I switched to a CF5 server and the 2nd GET stopped.

I would follow Mack's advice and switch redirect to no