Question

Get a page using the httpWebRespond check the received text with the debugger and see that the links are not complete, i.e. If the code of page look in firefox like

<a href = "http:\www.server.ru\mainpage.asp"> </a>

but after getting html page by GetResponseStream () I see the following

<a href = "mainpage.asp "> </a>.

How did receive a response full of links?

Was it helpful?

Solution

Yout don't. Relative url's are perfectly acceptable per the RFCs. They are to be interpreted by the User Agent (that's you) as relative to the current url (that being the URL you retrieved whose content returned the relative URLs.)

You need to make them relative to that URL, so a relative URL like foobar.html on a page whose full URL is http://somedomain/alpha/bravo/charlie/index.html gets converted to http://somedomain/alpha/bravo/charlie/foobar.html.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top