S
Savas Ates
I have a vb.net web application. I want to post some variables to another
web page and take some values back and process them.
This is codes in my target url. I should post "langpair" cariable to my
target url and it will respond with a value depend on a value which i send.
<SELECT name=langpair><OPTION
value=en|de>English to German</OPTION><OPTION
value=en|es>English to Spanish</OPTION>
</select>
I must use post method. I must give a value for select object and post it to
my target url ? I heard about BeginGetRequestStream but i dont know how to
do it ?
Dim objURI As Uri = New Uri("http://www.isbuluyorum.com/translate")
Dim objWebRequest As WebRequest = WebRequest.Create(objURI)
objWebRequest.ContentType = "text/html; charset=utf-8"
objWebRequest.Method = "POST"
'BEFORE to get response i should post variables to other web page ?
Dim objWebResponse As WebResponse = objWebRequest.GetResponse()
Dim objStream As Stream = objWebResponse.GetResponseStream()
Dim objStreamReader As StreamReader = New StreamReader(objStream)
Dim strHTML As String = objStreamReader.ReadToEnd
Response.Write(Server.HtmlEncode(strHTML))
web page and take some values back and process them.
This is codes in my target url. I should post "langpair" cariable to my
target url and it will respond with a value depend on a value which i send.
<SELECT name=langpair><OPTION
value=en|de>English to German</OPTION><OPTION
value=en|es>English to Spanish</OPTION>
</select>
I must use post method. I must give a value for select object and post it to
my target url ? I heard about BeginGetRequestStream but i dont know how to
do it ?
Dim objURI As Uri = New Uri("http://www.isbuluyorum.com/translate")
Dim objWebRequest As WebRequest = WebRequest.Create(objURI)
objWebRequest.ContentType = "text/html; charset=utf-8"
objWebRequest.Method = "POST"
'BEFORE to get response i should post variables to other web page ?
Dim objWebResponse As WebResponse = objWebRequest.GetResponse()
Dim objStream As Stream = objWebResponse.GetResponseStream()
Dim objStreamReader As StreamReader = New StreamReader(objStream)
Dim strHTML As String = objStreamReader.ReadToEnd
Response.Write(Server.HtmlEncode(strHTML))