http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.address(VS.71).aspx
You seem to be confused because it is the base class (WebRequest) which does not have an Address property. In the code above, your object is of type WebRequest, while the underlying type is HttpWebRequest. I think you need only use the latter. On Jun 22, 6:53 am, netdev1 <[email protected]> wrote: > Thanks, but no Address property for HttpWebRequest > > On Jun 19, 12:40 pm, Cerebrus <[email protected]> wrote: > > > > > HttpWebRequest.Address property ? > > > On Jun 19, 5:45 am, netdev1 <[email protected]> wrote: > > > > How can we extract a final destination url from code using the > > > httprequest object after a redirect? > > > > sample: > > > > string url = "http://url1.com"; > > > > //url1.com re-directs to url2. How can we get the url for url2 in > > > code? > > > > WebRequest obj1 = System.Net.HttpWebRequest.Create(url); > > > obj = obj1.GetResponse(); > > > using (StreamReader sr = new StreamReader > > > (obj.GetResponseStream())) > > > { > > > r = sr.ReadToEnd(); > > > sr.Close(); > > > } > > > > Thank you.- Hide quoted text - > > - Show quoted text -
