473,657 Members | 2,555 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sending POST to a web page

Hello everyone,
How can I sand a post to a web page?
I want that when the page is trying to fetch a post variable, it will
be something the program defined first.
Please help,
Ofir.
Nov 19 '07 #1
13 2361
Ofir,

Have you looked at the WebClient, or the HttpWebRequest/HttpWebResponse
methods? On all of them, you can set the Method to "POST" to post data to
the server in the request.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"ofiras" <of****@gmail.c omwrote in message
news:2c******** *************** ***********@e10 g2000prf.google groups.com...
Hello everyone,
How can I sand a post to a web page?
I want that when the page is trying to fetch a post variable, it will
be something the program defined first.
Please help,
Ofir.

Nov 19 '07 #2
Thanks a lot.
I never used net with C#, so it's new to me.
I've tried to use the WebClient class, but I didn't understand how can
I post data, so in PHP or ASP or others they can take it as a
variable.
This variable has a name and in PHP for e.g. it's $_POST['name'].
I thought the method UploadString in the WebClient class will help me.
It looks like:
UploadString(ad ress,method,dat a)
The address is the http address, the method will be post, but I didn't
understand how to determine the name of the post variable and his
contents.
And where do I get the respond? Can I get the URL and html code of the
page, which I have been directed to? Can I see it in the WebBrowser in
my form?
Thanks,
Ofir.
(Sorry if i have grammer or spelling mistakes, i don't know english
very good)
Nov 19 '07 #3
Thanks a lot...
That was very helpful, and I did it.
Just one problem - the respond html code is partly in Hebrew, and it
shows instead of Hebrew question marks.
Is there a way to fix it?
And I want to show the html code in the WebBrowser, but when I do it,
there are a lot of "<a href='index.htm l'>" for e.g., same for images
and forms "action".
Is there a way to make the WebBrowser know the path so if I press a
link like this, it will direct me to the right address? (If not I
guess I'll have to check for those things and change them...)
Thanks,
Ofir.
Nov 20 '07 #4
Thank you all, I managed to solve everything I asked here.
But after I solved everything, I have another problem:
The page I've been posting data to should make cookies in my computer,
but because I didn't send this post in explorer, it didn't.
It's a very big problem, because I need the cookies to be applied to
the "WebBrowser " tool in C# so I can show the page.
Is there a way of solving it?
Please help,
Ofir.
Nov 20 '07 #5
Liz

"ofiras" <of****@gmail.c omwrote in message
news:f3******** *************** ***********@b32 g2000hsa.google groups.com...
Thank you all, I managed to solve everything I asked here.
But after I solved everything, I have another problem:
The page I've been posting data to should make cookies in my computer,
but because I didn't send this post in explorer, it didn't.
It's a very big problem, because I need the cookies to be applied to
the "WebBrowser " tool in C# so I can show the page.
Is there a way of solving it?
Please help,
Ofir.
Sending cookies should be relatively easy from where you are now; you really
should have a look at the structure of an HTTP request header to better
understand the things you're coding here .. I don't have a good link to send
you but it shouldn't be hard to find

Receiving and persisting cookies is a different story; your browser of
course has been doing this work for you all these years but it doesn't just
happen "automatically; " you'll have to parse the HTTP response, extract the
cookies and do with them whatever needs doing

I think there's an open-source tool that will let you inspect the raw HTTP
traffic but I cannot recall the name of it ... anyone else? if it can be
unearthed one way or the other you probably want to use it so you can
demystify this process
Nov 20 '07 #6
Liz wrote:
I think there's an open-source tool that will let you inspect the raw HTTP
traffic but I cannot recall the name of it ... anyone else? if it can be
unearthed one way or the other you probably want to use it so you can
demystify this process
For network traffic watching, Ethereal.
Firebug is a pretty decent browser plugin (for Firefox) as it lets you
see all elements of a request and the resultant response - and it can
even handle AJAX requests.

Chris.
Nov 20 '07 #7
On 2007-11-20 12:33:55 -0800, Chris Shepherd <ch**@nospam.ch sh.casaid:
Liz wrote:
>I think there's an open-source tool that will let you inspect the raw
HTTP traffic but I cannot recall the name of it ... anyone else? if it
can be unearthed one way or the other you probably want to use it so
you can demystify this process

For network traffic watching, Ethereal.
Noting that what was previously called Ethereal is now "Wireshark"
(some sort of trademark issue resulted in the name change when the
original Ethereal project split, or something like that).

Nov 20 '07 #8
Liz

"Chris Shepherd" <ch**@nospam.ch sh.cawrote in message
news:uD******** ******@TK2MSFTN GP06.phx.gbl...
>Liz wrote:
Firebug is a pretty decent browser plugin (for Firefox) as it lets you see
all elements of a request and the resultant response - and it can even
handle AJAX requests.
that's a pretty impressive product !

http://www.getfirebug.com/

Nov 22 '07 #9
I didn't really understand what to do with them? Explore they're code?
Isn't there a way to load the page I send post to in the web browser
tool? I guess it's easier that transfer the cookies by myself...
I just need something that will let me to set the post variables, and
to show the page I want, with those variables, in web browser tool...
Please help,
Ofir.
Nov 22 '07 #10

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

Similar topics

20
2479
by: CHIN | last post by:
Hi all.. here s my problem ( maybe some of you saw me on other groups, but i cant find the solution !! ) I have to upload a file to an external site, so, i made a .vbs file , that logins to the site, and then i have to select the file to upload.. i used sendkeys.. and i worked perfect.. BUT ... the computer must be locked for security ( obviusly ) reazons.. so..i think this probable solutions to unlock the computer and run the...
2
1634
by: Marcelo | last post by:
Hi guys, I'm using the following code to send values from one page to another, but seems to me, that the event Page_Load in the receiving page never fires. Why? This is the code: Thanks -*-*-*-*-*-*
7
3512
by: Lau | last post by:
I need to send 1000 emails from an asp.net website. Normally I would use System.Web.Mail.MailMessage() to send thru an SMTP server. But the large amount of emails results in a timeout. My server administrator told me to write the emails to the “pickup directory” instead. I know that JMail can do this in ASP, but how do you do this in asp.net? -- --------------------
5
3022
by: Vishal | last post by:
Hello, I already asked this question in the ASP.NET forums, but no help came. So I am hoping that somebody can help me out. This is really very URGENT me. For my e-commerce application, I need to send data from my server via the post method to the payment server. The payment server does not run asp.net. I dont know what they run. The payment server then returns to my server with the
0
1210
by: Ricardo Magalhaes | last post by:
Hi, I have an ASPX page and I need to call an ASP page sending parameters like Name, Adress, ie. using POST method. This next ASP page show payment informations.. If was from an ASP to another ASP page I'll write the code: <form action=boleto.asp method=post> <input type=text name="adress" value="adress abc">
3
7719
by: Sydney | last post by:
Hi, I am trying to construct a WSE 2.0 security SOAP request in VBScript on an HTML page to send off to a webservice. I think I've almost got it but I'm having an issue generating the nonce value for the UserName token. Is it possilbe at all to do this from VBScript (or jscript?)? I know I will be limited with what I can do with the SOAP message. Eg/ can't sign/encrypt it etc. Thanks,
1
2857
by: R.A.M. | last post by:
Hello, I have written an .aspx page which calls Calendar.aspx page to select birth date which should be assign to some text box control on first page. Here's the code of first page: Birthdate: <asp:TextBox ID="Birthdate" runat="server" ValidationGroup="Birthdate" /> <asp:Button ID="Calendar" runat="server" Text="Calendar"
2
3020
by: jabdulius | last post by:
Hi all, I'm trying to send a page using Perl via the WCTP protocol. For some reason, I cannot connect to the host "wctp.att.net/WCTP" (or any host for that matter). I figure it must be some server configuration that I need to set. I don't think it's a port problem b/c I'm able to send a page via WCTP using the same port using a stand-alone app. Anyhow, here's the code I'm using: sub send_wctp_old{ #my $url =...
0
8403
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8833
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7345
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6174
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 presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5636
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4168
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4327
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1730
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.