How to get HTML from a relative URL? WebRequest, WebResponse won't work in my case

  • Thread starter Thread starter John
  • Start date Start date
J

John

I am in need to find a way to get the HTML from an internal URL.
For example: I have page : default.aspx?page=Test, I need to get HTML of
that page after rendering.

At first thought, I would use WebRequest to make a requestion, then use
WebResponse to get the HTML. However, it won't work in my situation.
The resaon for that is:
WebRequestion needs a URI, which is in the format of
http://<MyDomainName>/deafult.aspx?page=Test ...
In my particular situation, the web server does not recogonize MyDomainName
(an external domain name), so if I put:
Dim req As WebRequest =
WebRequest.Create("http://MyDomainName/Default.aspx?page=Test") , error will
occur.

Is there any way to achieve what WebRequest and WebResponse can achieve, but
requires a relative URL?
Thanks
 
John said:
I am in need to find a way to get the HTML from an internal URL.
For example: I have page : default.aspx?page=Test, I need to get
HTML of that page after rendering.

At first thought, I would use WebRequest to make a requestion, then
use WebResponse to get the HTML. However, it won't work in my
situation. The resaon for that is:
WebRequestion needs a URI, which is in the format of
http://<MyDomainName>/deafult.aspx?page=Test ...
In my particular situation, the web server does not recogonize
MyDomainName (an external domain name), so if I put:
Dim req As WebRequest =
WebRequest.Create("http://MyDomainName/Default.aspx?page=Test") ,
error will occur.

Is there any way to achieve what WebRequest and WebResponse can
achieve, but requires a relative URL?

Can't you use localhost or an IP address?

Cheers,
 
Back
Top