Witam, za pomocą sslstream wysyłam posta, przy połączeniu używam certyfikatu, niestety za każdym razem otrzymuje error 400, co robie nie tak, poniżej kawałek kodu
SSLStreamClient client= new SSLStreamClient();
client.Connect();
string date = DateTime.Now.ToString("yyyy-MM-ddThh:mm:ss.fffZ");
var json = "{'commandId':'TTT", 'command':{'attributes':{'typ':'CQC'}}}";
StringBuilder sb = new StringBuilder();
/*
sb.AppendLine(String.Format("POST {0} HTTP/1.1", new Uri("https://xxx.xxx.xxx.xxx/api/Serwer/Command").LocalPath));
sb.AppendLine(String.Format("Host: {0}", new Uri("https://xxx.xxx.xxx.xxx/api/Serwer/Command").Host));
string boundary = "----------------------------" + DateTime.Now.Ticks.ToString("x");
sb.AppendLine(String.Format("Content-Type: multipart/form-data; boundary={0}", boundary));
sb.AppendLine("Connection: keep-alive");
sb.AppendLine("");
sb.AppendLine("Content-Length:" + json.Length);
sb.AppendLine("");
sb.AppendLine("");
sb.AppendLine("Content-Type: application/json; charset=utf-8");
sb.AppendLine("Accept: application/json");
sb.AppendLine("");
sb.AppendLine(json);
byte[] headerBytes = Encoding.UTF8.GetBytes(sb.ToString());
client.Write(headerBytes);
richTextReader.Text = client.Read();