private string Serialize(BugSenseRequest errorReport) { var ms = new MemoryStream(); using (var requestStream = new StreamWriter(ms)) { requestStream.Write("data="); requestStream.Write(Uri.EscapeDataString(ToJsonString(errorReport))); } return(Encoding.UTF8.GetString(ms.ToArray())); }
internal void SendOrStore(BugSenseRequest errorReport) { string serializedErrorReport = Serialize(errorReport); try { Send(serializedErrorReport); } catch (IOException) { Store(serializedErrorReport); } catch (SecurityException) { Store(serializedErrorReport); } }