1

I have consumed Zendesk rest apis to create the case and below is the peace of code

byte[] bytes = Encoding.UTF8.GetBytes(strXML);
DisputeResolutionEntity disputeResolutionEntity = new DisputeResolutionEntity();
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(ConfigurationManager.AppSettings["zendeskAdd"].ToString());
request.Method = "POST";
password = Clearshift.Registration.CommonFunction.DecryptString(password);
request.Credentials = new NetworkCredential(userName, password);
request.ContentType = "application/xml";
request.ContentLength = bytes.Length;
Stream requestStream = request.GetRequestStream();
requestStream.Write(bytes, 0, bytes.Length);
requestStream.Close();
HttpWebResponse response = (HttpWebResponse)request.GetResponse();

I found that "Length" and "Position" properties of "Stream" object is returning below the error:

Length = 'requestStream.Length' threw an exception of type 'System.NotSupportedException'

Can anybody help?

RononDex
  • 4,143
  • 22
  • 39
Dhaval Panchal
  • 612
  • 4
  • 12
  • 32

0 Answers0