473,379 Members | 1,260 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

coldfusion cfhttp command interaction

Hello,
I'm Francesco and I write from Italy. I have a web site made in ColdFusion
that makes an HTTP request to another site in coldfusion using the tag
CFHTTP. The result of the call is sent to the page. Now I have to re-create
the web site in ASP.NET but I don't now how to generate and process an HTTP
request in .NET . I tryed the HttpWebRequest but maybe i'm in the wrong way.
Thanks in advance for the help
Nov 18 '05 #1
2 1558
Hi Francesco,

If you know the names of the fields that the target page expects, you can
put them into a name/value collection and post them using
System.Net.WebClient.

Here's a little code that might get you started:
Sub DoPost()
Dim uriString As String = _
"http://localhost/p4320work/mySpecialPage.aspx"
Dim strGoName As String
strGoName = TextBox1.Text
' Create a new WebClient instance.
Dim myWebClient As New System.Net.WebClient
Dim myNameValueCollection As New _
System.Collections.Specialized.NameValueCollection
myNameValueCollection.Add("go1", strGoName)
myNameValueCollection.Add("Button1", "")
Dim responseArray As Byte() = myWebClient.UploadValues _
(uriString, "POST", myNameValueCollection)

Label1.Text = "Response received was :" & _
System.Text.Encoding.ASCII.GetString(responseArray )
End Sub

Let us know if this helps?

Ken
Microsoft MVP [ASP.NET]
Toronto
"Francesco" <Fr*******@discussions.microsoft.com> wrote in message
news:3C**********************************@microsof t.com...
Hello,
I'm Francesco and I write from Italy. I have a web site made in ColdFusion
that makes an HTTP request to another site in coldfusion using the tag
CFHTTP. The result of the call is sent to the page. Now I have to
re-create
the web site in ASP.NET but I don't now how to generate and process an
HTTP
request in .NET . I tryed the HttpWebRequest but maybe i'm in the wrong
way.
Thanks in advance for the help


Nov 18 '05 #2
Ciao Ken,

I solved my problem thanks to your help.

Many thanks

Francesco

"Ken Cox [Microsoft MVP]" wrote:
Hi Francesco,

If you know the names of the fields that the target page expects, you can
put them into a name/value collection and post them using
System.Net.WebClient.

Here's a little code that might get you started:
Sub DoPost()
Dim uriString As String = _
"http://localhost/p4320work/mySpecialPage.aspx"
Dim strGoName As String
strGoName = TextBox1.Text
' Create a new WebClient instance.
Dim myWebClient As New System.Net.WebClient
Dim myNameValueCollection As New _
System.Collections.Specialized.NameValueCollection
myNameValueCollection.Add("go1", strGoName)
myNameValueCollection.Add("Button1", "")
Dim responseArray As Byte() = myWebClient.UploadValues _
(uriString, "POST", myNameValueCollection)

Label1.Text = "Response received was :" & _
System.Text.Encoding.ASCII.GetString(responseArray )
End Sub

Let us know if this helps?

Ken
Microsoft MVP [ASP.NET]
Toronto
"Francesco" <Fr*******@discussions.microsoft.com> wrote in message
news:3C**********************************@microsof t.com...
Hello,
I'm Francesco and I write from Italy. I have a web site made in ColdFusion
that makes an HTTP request to another site in coldfusion using the tag
CFHTTP. The result of the call is sent to the page. Now I have to
re-create
the web site in ASP.NET but I don't now how to generate and process an
HTTP
request in .NET . I tryed the HttpWebRequest but maybe i'm in the wrong
way.
Thanks in advance for the help


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Michael Wood | last post by:
We're using mailman (python based) to do mailing lists. I'd like to write a ColdFusion interface to the command line scripts for managing list membership but there's a problem. I can run the...
1
by: TEK | last post by:
Hello I'm wondering if anyone out there might give some input/suggestions/viewpoints around the Command pattern. In my case, the number one priority for using the pattern is undo support. Some...
1
by: John Dalberg | last post by:
What is the equivalent asp.net for the ColdFusion code below? <cfhttp url="http://www.xxx.com/cgi-bin/changepassword.exe" method="post"> <cfhttpparam type="FORMFIELD" name="domainname"...
7
by: Alex | last post by:
Hi all, I've been writing in ColdFusion for about 6 years now, and now that we've installed a Sharepoint Portal Server I'm finding that I need to use ASP.Net to make database calls. I'm finding...
2
by: am_pcguy | last post by:
I have a web based application for my company. We use Coldfusion, I wanted to see if I could use Javascript to make the page a bit more dynamic. Right now I use the command: <cfhttp...
7
acoder
by: acoder | last post by:
This page will link to a number of tutorials. Coldfusion Language Coldfusion Variables Using Coldfusion Variables Coldfusion Image Gallery How to upload a file in Coldfusion How to send...
3
by: sj3vans | last post by:
I'm trying to integrate a ColdFusion application with a webAPI provided by another company to access their services. Their requirements are that requests should be generated using standard HTTP...
0
by: Omar Abid | last post by:
Reason of this project: The Microsoft.VisualBasic.Interaction class exposes many useful commands and methods that were available in Visual Basic like AppActivate, Beep, Callbyname... This...
7
by: SAL | last post by:
Hopefully someone will have a clue as to what is happening here. In our office, we have both ColdFusion and ASP.NET applications. One of our new developers has been installing ColdFusion 8 on the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.