How to pass below content-type in http client using C# ?

multipart/alternative;  
boundary=56CC414C-FDE6-48DB-846C-6A1CEBCD7805;  
type=\"text/plain\"  
有帮助吗?

解决方案

Something like this should work,

var multipartContent = new MultipartContent("alternative","56CC414C-FDE6-48DB-846C-6A1CEBCD7805");
multipartContent.Add(new StringContent("Here is some content"));

var httpClient = new HttpClient();
httpClient.PostAsync("http://example.org/",multipartContent);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top