nganphant
9/28/2017 - 6:13 AM

Send File Using Https

for https SSL

//for https SSL
// build SSL sample user at https://weblogs.asp.net/scottgu/tip-trick-enabling-ssl-on-iis7-using-self-signed-certificates
System.Net.ServicePointManager.ServerCertificateValidationCallback += (send, certificate, chain, sslPolicyErrors) => { return true; };

//when server accept only binary byte, then use below methods
byte[] responseArray = client.UploadData(Config.Seigyo.hpserver_URL, "POST", File.ReadAllBytes(csvFile));
msg = System.Text.Encoding.Default.GetString(responseArray);//as this server will return json, let read it
JsonHP returnFromHP = Newtonsoft.Json.JsonConvert.DeserializeObject<JsonHP>(msg);