Hi Friends over here,
I'm using httpwebrequest and httpwebresponse to send and recieve data between windows form in my project and web page (ASP) using GET method,
what I need is how to send same thing Using POST
I found some example in MSDN but it was not clear for me and not working !!!
Please help me as soon as possible.

Method POST to send Data from windows form to ASP web page and get response
vanita
Dear
Webservices can range from the simple to the complex. I assume you have an ASP serving site
I'd recommend a couple of things. Get the ATLAS VSI.
There are "Hello World" webservice templates. They can be as simple as a basic program or they can be very complex.
One magnificent thing is that VS2005 comes with it's own development webserver that works as a localhost to help you with debugging.
In order to play with this, make a new website as you would a new project.
Add a webservice to the web site (aspx page)
It's really very easy and provides the infrastructure for everything you are asking for. I just finished a moderate sized undertaking with this and the webservice was the least of the challenges.
hharding
Hi there,
The main differences between POST and GET methods is the quantity of data that can be sent and security, so if you'r sending a simple form (Like registertation form or editing database record) you can just use GET method.
For more complex missions (Sending Files, Long Paragraphs) you can use POST method. It will give you more secure method of sending data and it send unlimited amout of data (Like huge files uploading).
But for you it's the same , meaning you can replace GET with POST and the form will work just fine and vise vers unless you have a <INPUT TYPE=FILE>, then you have to use POST.
THe way GET sends information is <NAME,VALUE> pairs and is sends them through URL i.e. xxxx.aps Name1=Value1&Name2=Value2 But POST sends information through spcial protocols and you can send tell the form to POST your data in mutiparts (ideal for file uploading and forms with lots of inputs.
Abdullah Al-Rasheed
Andrew_Shough
It's really an excellent monitor of transactions between servers and browsers and I think it would really help you with your application. Fiddler has the ability to hand construct get and post string and to get and post those strings and to watch a server's responses.
Fiddler is on the net and is free.
Sherif Elian
I'm expert in ASP 3.0, and I have been useing WebClient Namespace to solve my problem as seen in my previous reply.
I have little information about web services but I'm going learning deeply about it.
Thank You for All.
BillH
Chris Cormier
Just One Question please, is this tool integrated with VB.Net or It is spererated tool
KK Wong
Suchat
I hope to be good expert :)
Dave LaFlamme
Morg
Since work is done across several environments, webservice code, the server and client-side java script, there is no singular tool to deal with all of this. You have to be icredibly resourceful to get information on failures including the system event vent when a webservice has an exception.
VS2005 is very good for working on both web services and client side javascripts with caveats. The local server does not work for mapping environments such as Virtual earth because those technique require importing and interacting with classess on external servers. At times the last and only resort is to debug client side java while it is being served in a full fledged IIS environment.
In learning about all of this, I've discovered Fiddler. It is a standalone tool that monitors all interactions between a browser and whatever it is communicating with and it's really good for that. Fiddler is a wonderful tool for constructing get and post requests and I've used it to fashion get and post requests as you are interested in and have sucessfuly interacted with simple webservices using it. It's free. Also, if you do client side work, microsoft has a wonderful DOM explorer that is fully intergrated with IE. So because there are so many environments there are a lot of tools to used and its impossible at this point to have but a singular tool.
I have found webservice and client side interaction to be some of the more complicated work I've ever done in my thirty years of experience in computing.
There is one area where IE could impove for client side work. The debugging reporting for client side work it almost none existent. You will find that error messages for developers are vague and often incorrect. I am told that the jva console will reflect error conditions accurately but I have yet to try this out.
I really hope this helps.
I'd love to have some HTML/ASPX architectural help and I am told that the asp.net forum is the place to go for that. Although I look at that board and have been on it, my sense is that there isn't any real place to go to get help in that area.
Roberson
Really I do thanks for you but you are talking about sending from HTML form, but I'm talking about windows form what I mean is VB2005 windows application form so thre is no what you said as <INPUT TYPE=FILE>.
Any way I found the solution:
Dim
myHttpWebRequest As HttpWebRequest = _ CType(WebRequest.Create("http://www.localhost/test.asp"), HttpWebRequest)myHttpWebRequest.Method =
"POST" Dim inputData As String = "Your Data that will sent"Dim XmlStream As New StreamReader(inputData ) Dim inputData As String = XmlStream.ReadToEnd Dim postData As String = "Data" + ChrW(61) + inputData Dim encoding As New ASCIIEncoding Dim byte1 As Byte() = encoding.GetBytes(postData) ' Set the content type of the data being posted.
myHttpWebRequest.ContentType =
"application/x-www-form-urlencoded" ' Set the content length of the string being posted.myHttpWebRequest.ContentLength = postData.Length
Dim newStream As Stream = myHttpWebRequest.GetRequestStream()newStream.Write(byte1, 0, byte1.Length)
newStream.Close() Dim HttpWResp As HttpWebResponse = _ CType(myHttpWebRequest.GetResponse(), HttpWebResponse) ' Insert code that uses the response object. Dim s As New StreamReader(HttpWResp.GetResponseStream)MessageBox.Show(s.ReadToEnd)
HttpWResp.Close()
Catch ex As WebExceptionMessageBox.Show(ex.Message)
End Tryand the asp page contain one line is
<%
response.write request.form("Data")
%>