Forum Xamarin.Forms

Error getting response stream (ReadDone1): ReceiveFailure

dannyZangeifdannyZangeif USMember
edited June 2016 in Xamarin.Forms

Cant figure out what the deal is!

This code has been working and left untouched. Not It keeps breaking with a: "Error getting response stream (ReadDone1): ReceiveFailure"...

As an FYI this code is happening on IOS.

`byte[] dataBytes = Encoding.ASCII.GetBytes(data);

            HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(getUploadUrl.uploadUrl);
            webRequest.Method = "POST";
            webRequest.Headers.Add("Authorization", uploadAuthorizationToken);
            webRequest.Headers.Add("X-Bz-File-Name", userName + ".json");
            webRequest.Headers.Add("X-Bz-Content-Sha1", sha1);
            webRequest.ContentType = "b2/x-auto";

            //byte[] bytes = File.ReadAllBytes(data);

            using (var stream = webRequest.GetRequestStream())
            {
                stream.Write(dataBytes, 0, dataBytes.Length);
                stream.Close();
            }


           WebResponse response = (HttpWebResponse)webRequest.GetResponse();`
Sign In or Register to comment.