难,求高手,php怎么获取httprequest和httpresponse信息
发布网友
发布时间:2022-08-28 20:20
我来回答
共1个回答
热心网友
时间:2024-08-17 07:25
HttpResponse输出文件:
Response.Clear();
Response.ContentType = "application/octet-stream";
//通知浏览器下载文件而不是打开
Response.AddHeader("Content-Disposition", "attachment; filename=aaa.csv");
var sw = new StreamWriter(response.OutputStream);
//cc.Write<CustomerData>(list, sw, csvFileDesc);
sw.Flush();
sw.Close();
HttpRequest获取文件:
var sr = new StreamReader(request.InputStream);