Bill,

I might have to disagree with you somewhat. When you use the <CFHTTP> tag,
CF does send the form data over to the target page as
application...form-urlencoded. And ASP should return the processed stuff
back to CF as text/html.

I've done a little testing with the following:

On test.cfm I had this code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
        <title>Untitled</title>
</head>

<body>

<cfhttp url="http://168.144.126.105/test.asp" method="post">
<cfhttpparam type="FormField" name="ThisVar" value="variable">

</cfhttp>

<cfoutput>
Let's see if this works: <br>
#cfhttp.filecontent#
</cfoutput>

</body>
</html>

and as for test.asp:

<%

AnotherVar = Request.Form("ThisVar")
SystemVar = Request.ServerVariables("CONTENT_TYPE")

%>

The value of AnotherVar is <%= AnotherVar %><br>
The value of SystemVar is <%= SystemVar %><br>

When I used my browser and typed in http://blah.blah/test.cfm

This is what I get in my browser window:

Let's see if this works:
The value of AnotherVar is variable
The value of SystemVar is application/x-www-form-urlencoded

===

(In this case test.cfm and test.asp are on different servers)
You're welcome to copy the code for test.cfm onto your server and to test it
against the code on my server (http://168.144.126.105/test.asp). I'd like to
know if you get the same results.

Regards

Leong

-----Original Message-----
From: Bill Plummer [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 30, 2000 10:10 PM
To: [EMAIL PROTECTED]
Subject: RE: Posting with <CFHTTP> to an Active Server Page


Leong,

It's not a localhost problem.  We have multiple servers to test against and
the problem is the same with remote servers.

As far as I can tell the problem is with the "Content Type".  ASP defaults
to "Content-Type: application/x-www-form-urlencoded" and CFHTTP always uses
"Content-Type: text/html".

If Content-Type is the problem, I have not been able to change it using the
CFHTTP tag.

Bill

-----Original Message-----
From: Leong Yew [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 26, 2000 1:43 AM
To: [EMAIL PROTECTED]
Subject: RE: Posting with <CFHTTP> to an Active Server Page


Bill,

I'm a bit baffled by this still. Does anyone listening in have any idea?

I'm still toying with the problem with the localhost reference in the URL
attribute. Theoretically, if you point the URL back to the local server --
127.0.0.1 it should be able to locate the action page. If it works with CFM
templates and HTM docs but not ASP, I'm wondering if the CF server has an
exclusive hold on it. This is my suspicion:

1. If you use CFHTTP and a local URL reference, CF server assumes that it is
an internal file and tries to access it directly. It parses both CFM and HTM
immediately.

2. Since ASP needs to be processed by IIS (am I right in saying this?) the
CF server will access the ASP code unparsed, which results in the problem
mentioned below.

3. The only way for CFHTTP to work is to make the URL an external call, ie.
use a domain-based URL instead of the localhost reference. CF will assume
that the file has to be accessed remotely. This way the ASP page will be
parsed properly.

Is this scenario correct?


Leong
-----Original Message-----
From: Bill Plummer [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 26, 2000 1:21 AM
To: [EMAIL PROTECTED]
Subject: RE: Posting with <CFHTTP> to an Active Server Page


Leong,

If I post to a CFM page, the #CFHTTP.filecontent# comes back complete.  But,
when I post to an ASP page, the #CFHTTP.filecontent# is empty.  No errors,
just an indication that the posting didn't occur.  When you debug the ASP
page, no form variables show up on that end.  Seems like a simple thing to
post to a page and have the page receive your form variables, but not for me
so far.  No hurry, have a good evening.

Bill

-----Original Message-----
From: Leong Yew [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 25, 2000 10:00 AM
To: [EMAIL PROTECTED]
Subject: RE: Posting with <CFHTTP> to an Active Server Page


Bill,

I'm not sure if I understand your intentions correctly. You mean to say that
if you're using CFHTTP to post form information to a cf template with the
code similar to the one below, it works. But when you use that exact code
below, it doesn't work? What error message/s are you getting?

If you do reply to this, sorry I won't be able to respond until tomorrow
morning. It's bedtime here in Australia.

Leong

PS:
Just a thought... Do you think ColdFusion is having problems with the
localhost reference (127.0.0.1)? Perhaps you could try a domain-based URL
instead?

-----Original Message-----
From: Bill Plummer [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 25, 2000 9:49 PM
To: [EMAIL PROTECTED]
Subject: RE: Posting with <CFHTTP> to an Active Server Page


Leong,

I have that code as you say, after the CFHTTP tags, and if I post to a CFM
page the content is displayed, but not if I post to a ASP page.  I have
included all my test code below.  If you have any more suggestions they
would be much appreciated.

Bill

CODE SAMPLE:

<CFSET Variables.ASPTest = "This is an ASP test">

<CFHTTP METHOD="POST"  URL="http://127.0.0.1/ASPPostTest.asp">
        <CFHTTPPARAM TYPE="Formfield"
                VALUE="#Variables.ASPTest#"
                NAME="MyFormField">
</CFHTTP>

<CFOUTPUT>

        File Type:  #CFHTTP.mimetype#<BR><BR>

        File Header: #CFHTTP.Header#<BR><BR>

        File Content Returned From posttest.cfm:<BR><BR>
                #CFHTTP.filecontent#

</CFOUTPUT>

-----Original Message-----
From: Leong Yew [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 25, 2000 1:19 AM
To: [EMAIL PROTECTED]
Subject: RE: Posting with <CFHTTP> to an Active Server Page


Bill,
What you've done here is to merely pass the form data to your asp page. You
must add the following (after the CFHTTP tags) if you want that CFM template
to display the results from the asp page:

<cfoutput>#cfhttp.content#</cfoutput>

Hope this helps.

Leong

-----Original Message-----
From: Bill Plummer [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 25, 2000 6:11 AM
To: [EMAIL PROTECTED]
Subject: Posting with <CFHTTP> to an Active Server Page


Has anyone got the information on how to post to an ASP with the CFHTTP tag.
I can post with another ASP or with an HTM file, but no luck with a CFM
using the tag.

In the sample code below I'm just posting a form variable.  The asp page
just prints back to me anything that comes in.  Works fine with an ASP or
HTM page...  But not with the code below in a CFM page.

<CFHTTP METHOD="POST"  URL="http://127.0.0.1/ASPPostTest.asp">
        <CFHTTPPARAM TYPE="Formfield"
                VALUE="#Variables.ASPTest#"
                NAME="MyFormField">
</CFHTTP>

Thanks,
Bill

----------------------------------------------------------------------------
--
 Archives: http://www.eGroups.com/list/cf-talk
 To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to