C# 使用http客户端发出POST请求
我正在尝试使用http客户端发出http web请求,传递C# 使用http客户端发出POST请求,c#,httprequest,httpclient,C#,Httprequest,Httpclient,我正在尝试使用http客户端发出http web请求,传递字典,因为参数具有图像字节数组 但是我不能用FormUrlEncodedContent作为它给我的内容编码 “无法从System.Collections.Generic.Dictionary转换为System.Collections.Generic.IEnumerableMakeDictionary。我已经使用正常的http web请求方法解决了, var Imagesvalues = new Dictionary<strin
字典
,因为参数具有图像字节数组
但是我不能用FormUrlEncodedContent作为它给我的内容编码
“无法从
System.Collections.Generic.Dictionary
转换为System.Collections.Generic.IEnumerableMakeDictionary
。我已经使用正常的http web请求方法解决了,
var Imagesvalues = new Dictionary<string, object>
{
{ "propertyid", newpropertyID },
{ "image", imageArray },
{ "featured", isFeatured }
};
var finalcontent = new FormUrlEncodedContent(Imagesvalues);
response = await client.PostAsync("http://localhost/modon/addimage", finalcontent);
featuresindex = featuresindex + 1;