HttpClient 发送multipart/form-data请求

添加body参数:
var formdata = new MultipartFormDataContent();
formdata.Add(new StringContent("2312"), "userId");
formdata.Add(new StringContent("1"), "payamount");
formdata.Add(new StringContent("小王"), "name");
替换Boundary内的双引号:
var boundaryValue = formdata.Headers.ContentType.Parameters.Single(p => p.Name == "boundary");
boundaryValue.Value = boundaryValue.Value.Replace(""", String.Empty);

HttpClient 发送multipart/form-data请求

上一篇:Laravel-AJAX-分页


下一篇:PhpPgAdmin