Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CFHTTP Post is doing a second GET request right after

Guest
Jun 03, 2009 Jun 03, 2009

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

TOPICS
Advanced techniques
745
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 04, 2009 Jun 04, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 06, 2009 Jun 06, 2009
LATEST
ok, I switched to a CF5 server and the 2nd GET stopped.

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 04, 2009 Jun 04, 2009

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 04, 2009 Jun 04, 2009

I would investigate the problem further because I worked pretty

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

Mack

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources