473,396 Members | 1,785 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,396 software developers and data experts.

Get url returned from request redirect

Right now I am posting data to a webpage by doing the following

webRequest =
CType(System.Net.WebRequest.Create("http://www.domain.com/login.asp"),
Net.HttpWebRequest)

webRequest.Method = "POST"

webRequest.CookieContainer = Cookies

postData = "Submit=Go&id=asdDSDFsdf&pid=34g4"

data = System.Text.Encoding.UTF8.GetBytes(postData)

webRequest.ContentType = "application/x-www-form-urlencoded"

webRequest.ContentLength = data.Length

Dim RequestStream As IO.Stream = webRequest.GetRequestStream

RequestStream.Write(data, 0, data.Length)

RequestStream.Close()

webResponse = CType(webRequest.GetResponse(), Net.HttpWebResponse)

Now when I send that, the response is a new webpage (it redirected to it
after it authenticated my login account) I dont want to get the entire page
retured, I just want the URL that the new page is on, is there any way to do
this with out downloading the entire response (its large and a waste of
bandwidth since all I need is just the URL)... the URL is in the format of
http://www.domain.com/nextpage.asp?G...5G45G45WGREGDG

Any help would be nice, thanks!
Mar 10 '07 #1
2 1769
On Mar 10, 3:28 pm, "Smokey Grindel" <nos...@nospam.comwrote:
Right now I am posting data to a webpage by doing the following

webRequest =
CType(System.Net.WebRequest.Create("http://www.domain.com/login.asp"),
Net.HttpWebRequest)

webRequest.Method = "POST"

webRequest.CookieContainer = Cookies

postData = "Submit=Go&id=asdDSDFsdf&pid=34g4"

data = System.Text.Encoding.UTF8.GetBytes(postData)

webRequest.ContentType = "application/x-www-form-urlencoded"

webRequest.ContentLength = data.Length

Dim RequestStream As IO.Stream = webRequest.GetRequestStream

RequestStream.Write(data, 0, data.Length)

RequestStream.Close()

webResponse = CType(webRequest.GetResponse(), Net.HttpWebResponse)

Now when I send that, the response is a new webpage (it redirected to it
after it authenticated my login account) I dont want to get the entire page
retured, I just want the URL that the new page is on, is there any way to do
this with out downloading the entire response (its large and a waste of
bandwidth since all I need is just the URL)... the URL is in the format ofhttp://www.domain.com/nextpage.asp?GUID=45T45G45G45G45G45WGREGDG

Any help would be nice, thanks!
You have to get the entire response to find the url, I think. Or you
have to know your GUID

Mar 10 '07 #2
but even with the entire response how do you get the new url?
"Alexey Smirnov" <al************@gmail.comwrote in message
news:11*********************@q40g2000cwq.googlegro ups.com...
On Mar 10, 3:28 pm, "Smokey Grindel" <nos...@nospam.comwrote:
>Right now I am posting data to a webpage by doing the following

webRequest =
CType(System.Net.WebRequest.Create("http://www.domain.com/login.asp"),
Net.HttpWebRequest)

webRequest.Method = "POST"

webRequest.CookieContainer = Cookies

postData = "Submit=Go&id=asdDSDFsdf&pid=34g4"

data = System.Text.Encoding.UTF8.GetBytes(postData)

webRequest.ContentType = "application/x-www-form-urlencoded"

webRequest.ContentLength = data.Length

Dim RequestStream As IO.Stream = webRequest.GetRequestStream

RequestStream.Write(data, 0, data.Length)

RequestStream.Close()

webResponse = CType(webRequest.GetResponse(), Net.HttpWebResponse)

Now when I send that, the response is a new webpage (it redirected to it
after it authenticated my login account) I dont want to get the entire
page
retured, I just want the URL that the new page is on, is there any way to
do
this with out downloading the entire response (its large and a waste of
bandwidth since all I need is just the URL)... the URL is in the format
ofhttp://www.domain.com/nextpage.asp?GUID=45T45G45G45G45G45WGREGDG

Any help would be nice, thanks!

You have to get the entire response to find the url, I think. Or you
have to know your GUID

Mar 10 '07 #3

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

Similar topics

4
by: Max | last post by:
Hello. This is the first time I've posted to a newsgroup, and I do this because I'm in desperate need of help. I'm working a user management system, and when I activate a user that has registered...
6
by: Agoston Bejo | last post by:
Hi. x1.asp: <form method="post" action="x2.asp"> .... </form> x2.asp: DoSomeAdministration() Response.Redirect "x3.asp?" & Request.Form x3.asp: further processsing of data
7
by: Ivan Demkovitch | last post by:
Hi! Here is what I'm doing: I have Login.aspx with code to do forms authentification and I have this line at the end: Response.Redirect(Request.UrlReferrer.ToString()); I have other...
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
2
by: ad | last post by:
I have tree web page A.ASPX, B.ASPX and CheckPW.aspx There is a button in A.ASPX, the click of that button is redirect to B.ASPX .. I write a Page_Load event in b.aspx, if the Session is null...
0
by: Daatmor | last post by:
Hi, I've worte a program that will grab the html file content from web server. It's work ...
7
by: Carl | last post by:
these are three files below : submit.html <html> <head> </head> <body> <form action="redirect.php" method="POST" > <input type="text" name="value" value="test" > <input type="submit" >...
12
by: Mark Rae | last post by:
Hi, See the previous thread Request.Form abuse in this newsgroup... I'm looking for a simple and efficient way to prevent people hijacking the <formtags on my websites and using them to send...
1
by: Joe | last post by:
In ASP.NET 1.1 I could detected expired form authentication tickets (which closely coincide with my expired session) by checking for the Authentication Cookie when the login screen loads. If the...
2
by: Water Cooler v2 | last post by:
Normally, in ASP.NET applications, we read from a Request object and write to the Response buffer. However, I wish to read the request object, do some validations on it, and route the request to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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 project—planning, coding, testing,...

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.