核心代码如下
HttpClient client=new HttpClient();
var uri = new Uri("http://pda.labgic.vip/purch/uploadCont");
MultipartFormDataContent content = new MultipartFormDataContent();
StreamContent f = new StreamContent(File.OpenRead(filepath));
f.Headers.ContentType.MediaType = "multipart/form-data";
content.Add(f,"file",Path.GetFileName(filepath));
var response = await client.PostAsync(uri, content);