A
Andrew Davey
Any ideas why a request to a URI that returns a HTTP/1.1 302 Object
moved header works on my PC, but fails on the SmartPhone (windows
mobile 2003)
System.Net.HttpWebRequest request = null;
System.Net.HttpWebResponse response = null;
System.IO.Stream stream = null;
try
{
request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create("http://www.engadget.com/common/videos/pt/Engadget_Podcast22.mp3");
response = (System.Net.HttpWebResponse)request.GetResponse();
// WebException is thrown here ^^^
stream = response.GetResponseStream();
// ...
}
catch (System.Net.WebException ex)
{
System.Diagnostics.Debug.WriteLine(ex.ToString());
}
finally
{
if(response!=null) response.Close();
}
The exception message is "The response did not contain an end of
entity mark"
Watching the packets with PlasticSniffer I see that the code (running
in the phone) never attempts to make contact with the new server
specified in the 302 Location header.
Requesting the URL in Pocket IE on the phone works fine – just not
when running the code above. Is this a bug in the .NETCF?
Any ideas appreciated.
- Andrew Davey [http://www.equin.co.uk/ipoddersp]
moved header works on my PC, but fails on the SmartPhone (windows
mobile 2003)
System.Net.HttpWebRequest request = null;
System.Net.HttpWebResponse response = null;
System.IO.Stream stream = null;
try
{
request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create("http://www.engadget.com/common/videos/pt/Engadget_Podcast22.mp3");
response = (System.Net.HttpWebResponse)request.GetResponse();
// WebException is thrown here ^^^
stream = response.GetResponseStream();
// ...
}
catch (System.Net.WebException ex)
{
System.Diagnostics.Debug.WriteLine(ex.ToString());
}
finally
{
if(response!=null) response.Close();
}
The exception message is "The response did not contain an end of
entity mark"
Watching the packets with PlasticSniffer I see that the code (running
in the phone) never attempts to make contact with the new server
specified in the 302 Location header.
Requesting the URL in Pocket IE on the phone works fine – just not
when running the code above. Is this a bug in the .NETCF?
Any ideas appreciated.
- Andrew Davey [http://www.equin.co.uk/ipoddersp]