473,508 Members | 2,329 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2535
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
7216
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
6331
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
2385
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
2848
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
2193
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
4732
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
5957
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
8169
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
9561
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
8156
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
7123
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7324
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
7382
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...
1
5052
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...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3193
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3181
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1556
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.