c# webapi处理请求文件接口返回的Content-Type →text/plain
通过Header中的Content-Disposition属性获取文件名称和扩展名称
HttpWebResponse
HttpWebResponse response = request.GetResponse() as HttpWebResponse;
//文件名称
string filename= response.GetResponseHeader("Content-Disposition");
//文件扩展名称
string exp = filename.Split('.')[1];
WebClient
WebClient client = new WebClient();
//client.DownloadFile(url, saveFilePath + "2." + exp);
string filenamewc=client.ResponseHeaders["Content-Disposition"];