Re: Internet class differences...

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Thus wrote Peter,

I've tried this on another group without any resolution, so let me see
if anyone here has an answer - please! ;-)
[...]
I have used an ethernet sniffer to inspect the packets from the
WebClient (which works completely with simple queries) and the
HTTPWebRequest (which submits the query successfully but seems unable
to submit the cookie and sequence number properly to retrieve the
results). The only difference I can see in the packets is that the
WebCLient orders the header values slightly differently (the same
values are present but their order is different from the
HTTPWebRequest ordering of the same values) and the WebClient returns
not just the cookie name-value combination, but also the 'Path=/'
parameter from the internal cookie. The HTTPWebRequest has the Path
member set properly (to '/') but does not return this with the cookie
to the redirected server page - only the name-value members are sent.

I don't know if the order or the lack of a 'Path=/' in the
header/cookie causes the failure, but something is doing it and I
can't figure out how to change the behavior...

I'm tearing my hair out on this and looking for any help/ideas.

Thanks a lot for anything to follow up on! 8-)

Cookie processing in HttpWebRequest requires a single CookieContainer to be associated with each request in your HTTP "conversation". I guess you're missing one ;-)

Cheers,
--
Joerg Jooss
news-reply@xxxxxxxxxxxxx


.



Relevant Pages

  • Re: Internet class differences...
    ... Initially a WebClient class was used. ... This worked fine for submitting the query. ... The HTTPWebRequest object does a dandy job of allowing me to format my ... obtains the sessionID cookie from the first one. ...
    (microsoft.public.dotnet.general)
  • Internet class differences...
    ... The result of the query is an HTML page returned containing some parameters and a javascript method that opens a new window with the results... ... The same object - the WebClient - is redirected to the page and retrieves the query results. ... The HTTPWebRequest object does a dandy job of allowing me to format my queries so that the database at the other end is happy - I have tried a number of complicated ones and always receive the 'redirect' javascript response indicating that the query processed properly. ... I use the same cookiecollection for both the initial query request and the second results request so that the second object obtains the sessionID cookie from the first one. ...
    (microsoft.public.dotnet.general)
  • Re: WebClient.UploadData
    ... My real problem lies with the WebClient object and the HttpWebRequest/HttpWebResponse object; ... something that I have to manually code in or is HttpWebRequest broken in this regard, where Microsoft has to fix it? ... System.Net.HttpWebRequest request = base.GetWebRequestas System.Net.HttpWebRequest; ... I'm wondering if this has something to do with the Connection: Keep-Alive header. ...
    (microsoft.public.dotnet.general)
  • RE: WebClient
    ... HttpWebRequest/HttpWebResponse object (with AutoRedirect); Apparently, ... the cookies aren't set each time a redirect command is ... is HttpWebRequest broken in this regard, where Microsoft has to fix it? ... Try using this class instead of WebClient: ...
    (microsoft.public.dotnet.general)
  • Re: WebClient.UploadData
    ... HttpWebRequest/HttpWebResponse object (with AutoRedirect); Apparently, ... the cookies aren't set each time a redirect command is ... is HttpWebRequest broken in this regard, where Microsoft has to fix it? ... Try using this class instead of WebClient: ...
    (microsoft.public.dotnet.general)