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

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
 
J

Joerg Jooss

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top