请开发过的大佬指教下
try
{
IDingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/media/upload");
OapiMediaUploadRequest req = new OapiMediaUploadRequest();
req.Type = "image";
string webRootPath = _environment.WebRootPath;
string url = webRootPath.Replace(@"\", @"/") + "/media/"+" 20200512112734.jpg";
req.Media = new FileItem(url);
OapiMediaUploadResponse rsp = client.Execute(req, access_token);
return rsp.MediaId;
}
catch (Exception ex)
{
return "错误信息:"+ex;
}
类型肯定没问题的image