0

我正在使用 C# 创建一个程序,该程序将自动更新 Freshdesk 解决方案文章,但是当我运行我的代码时,它会毫无例外地运行,但不会更新文章。谁能告诉我我哪里出错了?

apiPath = $"/api/v2/solutions/articles/{articleID}";

string publishArticle = "{\"description\" : \"publish article\", \"status\" : 2}";

                request = (HttpWebRequest)WebRequest.Create("https://" + fdDomain + ".freshdesk.com" + apiPath);
                request.ContentType = "application/json";
                request.Method = "PUT";
                byte[] byteArray = Encoding.UTF8.GetBytes(publishArticle);
                request.ContentLength = byteArray.Length;
                request.Headers["Authorization"] = "Basic " + authInfo;


                using (var dataStream = request.GetRequestStream())
                {
                    dataStream.Write(byteArray, 0, byteArray.Length);
                }

4

0 回答 0