引用关键dll:RestSharp.dll
调用接口上传
public JsonResult PutImgAdd()
{
try
{
string folder = System.Web.HttpContext.Current.Request.Form["folder"].ToString();
HttpFileCollection fileList = System.Web.HttpContext.Current.Request.Files;//获取图片集合
if (fileList != null && fileList.Count > 0)
{
var client = new RestClient("接口地址");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddParameter("folder", "Cert");//参数
//可能存在多张图片循环添加
for (int i = 0; i < fileList.Count; i++) {
HttpPostedFile postfile = fileList[i];
Image drimg = Image.FromStream(postfile.InputStream);
byte[] bytes = GetB