Wrong Content-Type header generated using MultipartFormDataContent
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have the following code: private static string boundary = "----CustomBoundary" + DateTime.Now.Ticks.ToString("x"); private static async Task<string> PostTest() { string servResp = ""; using (var content = new MultipartFormDataContent(boundary)) { content.Add(new StringContent("105212"), "case-id"); content.Add(new StringContent("1/14/2014"), "dateFrom"); content.Add(new StringContent("1/15/2014"), "dateTo"); HttpClientHandler handler = new HttpClientHandler(); cookieContainer = new CookieContainer(); handler.CookieContainer =