473,406 Members | 2,293 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,406 software developers and data experts.

WebRequest

Hi,

I have to do a POST to an URI.

I already figured out this code:

WebRequest myRequest =
WebRequest.Create("https://select.worldpay.com/wcc/purchase");

myRequest.Method = "POST";
Question:
How can I add parameters to this request?
The sample provided by the owner of the web site in HTML was:

// <form action="https://select.worldpay.com/wcc/purchase" method="post">

// <input type="hidden" name="instId" value="53567563"> <input type="hidden"
name="cartId" value="1234TestcartID">

// <input type="hidden" name="amount" value="25.35"> <input type="hidden"
name="currency" value="EUR">

// <input type="hidden" name="desc" value="TestDesc"> <input type="hidden"
name="testMode" value="100">

// <input type="hidden" name="name" value="Christian Picke"> <input
type="hidden" name="address" value="Edingsesteenweg 492">

// <input type="hidden" name="postcode" value="9400"> <input type="hidden"
name="country" value="BE">

// <input type="hidden" name="tel" value="054/336034"> <input type="hidden"
name="email" value="in**@soft-service.net">

// <input type="submit" value="Buy This">

// </form>
Many thanks in advance,

Christian
Nov 17 '05 #1
2 2529
Salut Christian,
It seems like you might want to be using the WebClient class for this. The
UploadValues method lets you set any number of values to send along with the
post.

There are examples here:

http://msdn.microsoft.com/library/de...aluestopic.asp
"Christian Pické" <in**@soft-service.net> wrote in message
news:ew**************@tk2msftngp13.phx.gbl...
Hi,

I have to do a POST to an URI.

I already figured out this code:

WebRequest myRequest =
WebRequest.Create("https://select.worldpay.com/wcc/purchase");

myRequest.Method = "POST";
Question:
How can I add parameters to this request?
The sample provided by the owner of the web site in HTML was:

// <form action="https://select.worldpay.com/wcc/purchase" method="post">

// <input type="hidden" name="instId" value="53567563"> <input type="hidden"
name="cartId" value="1234TestcartID">

// <input type="hidden" name="amount" value="25.35"> <input type="hidden"
name="currency" value="EUR">

// <input type="hidden" name="desc" value="TestDesc"> <input type="hidden"
name="testMode" value="100">

// <input type="hidden" name="name" value="Christian Picke"> <input
type="hidden" name="address" value="Edingsesteenweg 492">

// <input type="hidden" name="postcode" value="9400"> <input type="hidden"
name="country" value="BE">

// <input type="hidden" name="tel" value="054/336034"> <input type="hidden"
name="email" value="in**@soft-service.net">

// <input type="submit" value="Buy This">

// </form>
Many thanks in advance,

Christian

Nov 17 '05 #2
Salut Christian,
It seems like you might want to be using the WebClient class for this. The
UploadValues method lets you set any number of values to send along with the
post.

There are examples here:

http://msdn.microsoft.com/library/de...aluestopic.asp
"Christian Pické" <in**@soft-service.net> wrote in message
news:ew**************@tk2msftngp13.phx.gbl...
Hi,

I have to do a POST to an URI.

I already figured out this code:

WebRequest myRequest =
WebRequest.Create("https://select.worldpay.com/wcc/purchase");

myRequest.Method = "POST";
Question:
How can I add parameters to this request?
The sample provided by the owner of the web site in HTML was:

// <form action="https://select.worldpay.com/wcc/purchase" method="post">

// <input type="hidden" name="instId" value="53567563"> <input type="hidden"
name="cartId" value="1234TestcartID">

// <input type="hidden" name="amount" value="25.35"> <input type="hidden"
name="currency" value="EUR">

// <input type="hidden" name="desc" value="TestDesc"> <input type="hidden"
name="testMode" value="100">

// <input type="hidden" name="name" value="Christian Picke"> <input
type="hidden" name="address" value="Edingsesteenweg 492">

// <input type="hidden" name="postcode" value="9400"> <input type="hidden"
name="country" value="BE">

// <input type="hidden" name="tel" value="054/336034"> <input type="hidden"
name="email" value="in**@soft-service.net">

// <input type="submit" value="Buy This">

// </form>
Many thanks in advance,

Christian

Nov 17 '05 #3

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

Similar topics

17
by: James Johnson | last post by:
Dear C#dex, I define a variable: HttpWebRequest webRequest and run the following request webRequest = WebRequest.Create(TARGET_URL) as HttpWebRequest; The webRequest object returns values...
3
by: Paul | last post by:
Hello, First I want to refer to the problem "WebRequest : execute a button" of a few days ago. The way I solved it, I loose my session, and as a consequence my session variables. I don't want...
8
by: John K. | last post by:
Hi I was wondering if it's possible to use the WebRequest class to access a file on windows shared folder with authentication? If yes, what would the syntax be? I've tried to look this up in the...
12
by: ThyRock | last post by:
I am working on a WebRequest accessing the US Postal Service WebTools test API. This service uses a DLL file (ShippingAPITest.dll) with a query string which includes XML. The web service accepts...
0
by: Gordon | last post by:
I use the following code to get source HTML. The second line seems to work when I get no response from a site. However, I want to stop the request if it's taking more than 20 - 30 seconds. I can't...
1
by: David Satz | last post by:
Hello--I just upgraded to Visual Studio .NET 2005 and suddenly, all my .NET 1.1 applications that accessed Web sites have broken. For example, this code: WebClient wc = new WebClient();...
2
by: kkb | last post by:
Hello! First, I'm sorry because of my english... I'll try to be understandable! I've got a strange problem using .NET 2003 C# and I haven't figured it out for a long time. I'm implementing an...
1
by: Mr Flibble | last post by:
OK I logon to a web site and I manage to get an SMSESSION cookie that I then store in a variable called _session (a class scoping variable). I do this by calling a logon URL and setting a cookie...
3
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. I'm trying to create a call to a web page to validate and register software. The code I'm using is: Private Sub OK_Click(ByVal sender As...
3
by: Dave | last post by:
string m_request = some_web_page; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(m_request ); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Which works...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.