Greetings - I'm working on my first MonoTouch app (other than Hello
World of course). I'm trying to do a POST to a web address so I can
get an authentication cookie that will be used in subsequent RESTful
calls. What I'm seeing is that when I do the post and include the post
data in the request stream, it times out when I call
HttpWebRequest.GetResponse(). If I remove the line of code that writes
to the request stream then I don't get a timeout.
Here's what the code looks like:
HttpWebRequest authRequest =
(HttpWebRequest)WebRequest.Create(this.AuthActionUrl);
authRequest.AllowAutoRedirect = false;
authRequest.Method = "POST";
byte[] postData = this.GetPostData();
authRequest.ContentType = "application/x-www-form-urlencoded";
authRequest.GetRequestStream.Write(postData, 0, postData.Length); //
Commenting this line out eliminates the timeout
authRequest.Headers.Add(Constants.SingleSignOn.COOKIE, string.Joing(" ",
cookieJar.ToArray()));
using (HttpWebResponse authResponse =
(HttpWebResponse)authRequest.GetResponse()) // This is where the
timeout occurs
{
cookieJar.Clear();
ProcessCookies(authResponse);
}
Any suggestions would be appreciated.
Thanks,
Chris
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch