Web Service Service Now Atualizando um incidente utilizando C#
private void ServiceNowUpdate()
{
string myResponse = "";
this.rtbOutput.Text = " Iniciando Update ... \r\n";
this.rtbOutput.AppendText("URL: " + txtURL.Text + "\r\n");
System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(txtURL.Text);
request.Method = "PUT";
request.KeepAlive = true;
request.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
request.UseDefaultCredentials = true;
request.Credentials = new System.Net.NetworkCredential("user", "password", "");
request.ContentType = "application/json";
request.Accept = "application/json";
string postData = "{ '" + txtField.Text + "':'" + txtValue.Text + "'}";
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
// Set the ContentLength property of the WebRequest.
request.ContentLength = byteArray.Length;
// Get the request stream.
System.IO.Stream dataStream = request.GetRequestStream();
// Write the data to the request stream.
dataStream.Write(byteArray, 0, byteArray.Length);
// Close the Stream object.
dataStream.Close();
System.Net.HttpWebResponse response;
response = (System.Net.HttpWebResponse)request.GetResponse();
this.rtbOutput.AppendText("\r\n");
this.rtbOutput.AppendText("\r\n");
//Newtonsoft.Json.Linq.JObject rss = Newtonsoft.Json.Linq.JObject.Parse(myResponse);
this.rtbOutput.AppendText(myResponse);
}
Outros documentos em português
https://www.servicenow.com/community/brazil-snug/web-service-service-now-atualizando-um-incidente-utilizando-c/ba-p/2280127