want to add new coment on ticket using assembla API, However gettig "Protocol Error" as return msg
string postURL = AssemblaUrls.TicketComment.Replace("[space_id]", SpaceName).Replace("[ticket_number]", ticketNumberToUpdate.ToString());
var request = (HttpWebRequest)WebRequest.Create(postURL);
request.PreAuthenticate = true;
request.Headers.Add("X-Api-Key: " + AppSecrete.CodeReviewApiKey);
request.Headers.Add("X-Api-Secret: " + AppSecrete.CodeReviewApiKeySecret);
request.Method =
WebRequestMethods.Http.Post;
request.Accept = "application/xml";
request.ContentType = "application/xml";
string postData = "<ticket_comment><comment>" + comment + "</comment>";
postData = postData + "</ticket_comment>";//relationship Value Relationship 0 Parent,1 Child,2 Related,3 Duplicate
request.ContentLength = postData.Length;
StreamWriter postStream = new StreamWriter(request.GetRequestStream(), System.Text.Encoding.ASCII);
postStream.Write(postData);
postStream.Close();
try
{
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
using (StreamReader sr = new StreamReader(response.GetResponseStream(), System.Text.Encoding.UTF8))
{
// string xmltext = Convert.ToString(sr.ReadToEnd());
///XDocument xd = XDocument.Parse(xmltext);
}
return "Updated successfully";
}