converting HTTPWebResponse object to HTTPResponse object

D

deepak

Hi All,

I have a httpwebresponse object(given below)

Dim req As WebRequest
Dim rsp As WebResponse

<....logic to read the http web request object.....>
rsp = req.GetResponse()


i want to convert in(or read in into) into exsiting httprequest object (say
named as 'Response')


How this can be done..?Any helo would be great for me..

Thanks,
Deepak
 
A

Anthony Jones

deepak said:
Hi All,

I have a httpwebresponse object(given below)

Dim req As WebRequest
Dim rsp As WebResponse

<....logic to read the http web request object.....>
rsp = req.GetResponse()


i want to convert in(or read in into) into exsiting httprequest object (say
named as 'Response')


How this can be done..?Any helo would be great for me..

Umm I think what you want is:-

Dim rsp As HttpWebResponse

.. . .

rsp = DirectCast(req.GetResponse(), HttpWebResponse);

This is client-side code. You use HttpWebRequest to send stuff and
HttpWebResponse to receive stuff. This is the client end of the HTTP
conversation.

The HttpRequest and HttpResponse objects are serverside objects, you use
HttpRequest to receive stuff and HttpResponse to send stuff. This is the
Server end of the HTTP conversation.

HttpResponse and HttpWebResponse types are entirely different classes
existing in different namespaces.
 
D

deepak

Hi Anthony,

Thanks, it was really helpful.Anothnay i have one more question which i
rsaied seperately to read the nodes which has date(s) or you ca say have a
fixed format (date format) and i need to conver those date(S) to utc while
seding to client side..May you have a look on that one also please...It would
be great help for me...really....

-Deepak
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top