Using typical HttpWebRequest code I noticed some odd behavior. Under Wifi it
works fine, but when trying to read a server php POST I get erratic results
under a cellular connection.

=======================================
HttpWebRequest request = (HttpWebRequest)WebRequest.Create (url);
request.Method = "POST";
request.ContentType = "application/json";

request.ContentLength = dataStream.Length;  
request.CookieContainer = http.cookies;

Stream newStream = request.GetRequestStream ();
newStream.Write (dataStream, 0, dataStream.Length);     
newStream.Close ();

HttpWebResponse response = (HttpWebResponse)request.GetResponse ();

StreamReader sr = new StreamReader(response.GetResponseStream());          

string r = sr.ReadToEnd().Trim();
Console.WriteLine("READ=["+r+"]");
============================================

I've tried several variations, but nothing seems to make a difference. When
reading from my server script on a cellular connection, I mostly get back
zero bytes. Sometimes I do get back the response expected. Under wifi it
always works. I have this type of code working with other frameworks hitting
the same scripts, but I cannot figure out what it is.

Any thoughts?

Thanks -Steve



--
View this message in context: 
http://monotouch.2284126.n4.nabble.com/HttpWebRequest-Issue-with-MonoTouch-only-under-cellular-transport-tp4656941.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to