Re: Accessing cookies returned in error responses with httpwebrequest (.net CF)
From: Alex White (lisaalexjade_at_yahoo.com.au)
Date: 10/18/04
- Next message: SvenAke: "Re: TextBox Cut'n'Paste"
- Previous message: Steven Licciardi: "Re: Is there a way to create SQL sdf files from a none Smart Device"
- In reply to: Alex White: "Accessing cookies returned in error responses with httpwebrequest (.net CF)"
- Next in thread: Feroze [msft]: "Re: Accessing cookies returned in error responses with httpwebrequest (.net CF)"
- Messages sorted by: [ date ] [ thread ]
Date: 18 Oct 2004 01:40:19 -0700
Hi,
Is there a way to access the headers inside error responses using httpwebrequest?
Cheers,
Alex.
lisaalexjade@yahoo.com.au (Alex White) wrote in message news:<bac0a66e.0410062342.9a20964@posting.google.com>...
> Hi,
>
> I'm currently developing an application on the ppc using the .NET
> compact framework, using HttpWebRequest and HttpWebResponse in
> asynchronous mode.
>
> I'm currently trying to authenticate (basic authentication) with a
> site protected by third party security software, and the initial
> request to the site returns a 401 (Access Denied). I can implement
> authentication using the NetworkCredential class, assigning this to
> the Credentials property.
>
> The problem is that the site uses cookies to track the user attempting
> access, and the 401 response includes some cookies which need to be
> passed back with the authentication details. Otherwise I cannot gain
> access.
>
> We all know that the CF does not support cookies, and I've overcome
> this problem in a different area by retrieving the important cookies &
> reinserting them manually (using the Headers property of the response
> and request), but when a 401 is returned from the site, I have no
> HttpWebResponse object to poach them from. (The call to EndGetResponse
> is supposed to return the HttpWebResponse object, but throws an
> exception in the case of a 401).
>
> I have a test application that I can run in the conventional
> framework, and I can replicate the problem by disabling the cookies.
> The authentication works as soon as I set the cookie container. So I
> know that the cookies are definitely the problem.
>
> Does anyone know how to access the headers returned in a server error
> response?
>
> Cheers,
> Alex.
- Next message: SvenAke: "Re: TextBox Cut'n'Paste"
- Previous message: Steven Licciardi: "Re: Is there a way to create SQL sdf files from a none Smart Device"
- In reply to: Alex White: "Accessing cookies returned in error responses with httpwebrequest (.net CF)"
- Next in thread: Feroze [msft]: "Re: Accessing cookies returned in error responses with httpwebrequest (.net CF)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|