converting HTTPWebResponse object to HTTPResponse object

  • Thread starter Thread starter deepak
  • Start date Start date
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
 
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.
 
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
 
Back
Top