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

CFHTTP Post is doing a second GET request right after

New Here ,
Jun 03, 2009 Jun 03, 2009

Copy link to clipboard

Copied

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

Views

685

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST
ok, I switched to a CF5 server and the 2nd GET stopped.

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

Votes

Translate

Translate

Report

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
New Here ,
Jun 04, 2009 Jun 04, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

I would investigate the problem further because I worked pretty

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

Mack

Votes

Translate

Translate

Report

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
Documentation