2020
12-14
12-14
C# 使用HttpClient上传文件并附带其他参数的步骤
HttpClient和MultipartFormDataContent(传送门)最低适用于.NETFramework4.5版本发送端代码using(HttpClientclient=newHttpClient()){varcontent=newMultipartFormDataContent();//添加字符串参数,参数名为qqcontent.Add(newStringContent("123456"),"qq");stringpath=Path.Combine(System.Environment.CurrentDirectory,"1.png");//添加文件参数,参数名为files,文件名为123.pngcontent.Add(new...
继续阅读 >