Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > converting HTTPWebResponse object to HTTPResponse object

Reply
Thread Tools

converting HTTPWebResponse object to HTTPResponse object

 
 
deepak
Guest
Posts: n/a
 
      02-14-2008
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
 
Reply With Quote
 
 
 
 
Anthony Jones
Guest
Posts: n/a
 
      02-14-2008
"deepak" <> wrote in message
news:5FF5ADE4-9D91-4C75-B67F-...
> 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.

--
Anthony Jones - MVP ASP/ASP.NET


 
Reply With Quote
 
 
 
 
deepak
Guest
Posts: n/a
 
      02-14-2008
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

"Anthony Jones" wrote:

> "deepak" <> wrote in message
> news:5FF5ADE4-9D91-4C75-B67F-...
> > 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.
>
> --
> Anthony Jones - MVP ASP/ASP.NET
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HttpResponse from background thread jurot ASP .Net 1 07-14-2004 02:55 PM
RE: How to read content of httpResponse.OutputStream =?Utf-8?B?Sm9zZSBGbG9yZXM=?= ASP .Net 7 05-18-2004 01:11 PM
HttpResponse Headers =?Utf-8?B?QWxleCBLbGltYW50b3Y=?= ASP .Net 0 04-02-2004 04:11 PM
HttpResponse.ValidateFileRange() Matthew Trunnell ASP .Net 0 02-06-2004 09:36 PM
Valid list of HTTPResponse.ContentType string types Robert Hanson ASP .Net 4 08-01-2003 02:48 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57