using System.Security.Cryptography;
public static void Main()
var client = new HttpClient(new HttpClientHandler { UseProxy = false });
var request = new HttpRequestMessage(HttpMethod.Post, document.Url);
request.Content = new StringContent(JsonConvert.SerializeObject(workOrderStatusChangeEvent), Encoding.UTF8, "application/json");
var encoding = new System.Text.ASCIIEncoding();
byte[] keyByte = encoding.GetBytes(document.Secret);
byte[] messageBytes = encoding.GetBytes(request.Content.ToString());
using (var hmacsha256 = new HMACSHA256(keyByte))
byte[] hashmessage = hmacsha256.ComputeHash(messageBytes);
request.Headers.Add("Sign-Data", Convert.ToBase64String(hashmessage));
Log.Information($"Sending post request to {request.RequestUri}.");
HttpResponseMessage response = await client.SendAsync(request);
Log.Information($"Response received {response.StatusCode}.");