- 将 WhatsApp 聊天添加到您的网站
- robots文件的写法解析
- #ifdef、 #define、 #else、 #endif
- axios与vue-resource 比较
- 长尾关键词拓展方法总结
- 网站的百度权重下降了是什么原因
- 短信猫卡发短信和网关短信在市场上的区别
- C#字符串的使用笔记
- .html后缀改成.aspx后 在ie6下变形错位的问题
- 从零开始学习ASP.NET MVC 1.0 (一) 开天辟地入门篇
邮箱:
手机:15383239821
通过Request.InputStream读取流
以下有两种方式可以获取响应的数据流
1. 接收端通过Request.InputStream读取流
public static string StreamRead()
{
byte[] byts = new byte[HttpContext.Current.Request.InputStream.Length];
HttpContext.Current.Request.InputStream.Read(byts, 0, byts.Length);
string req = System.Text.Encoding.UTF8.GetString(byts);
return HttpContext.Current.Server.UrlDecode(req);
}
2.
/// <summary>
/// 获得请求报文转换成字符串
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public static string getRequestBody(HttpRequestBase request)
{
string result = "";
using (Stream st = request.InputStream)
{
StreamReader sr = new StreamReader(st, Encoding.UTF8);
result = sr.ReadToEnd();
}
return result;
}
-
2013-06-15C# Eval在aspx页面中的用法及作用 .
-
2024-10-30常用MIME类型(Flv,Mp4的mime类型设置)
-
2010-07-20怎样确定网站优化的关键字
-
2010-07-20提升用户体验度要注意的几点
-
2013-04-02css怎么设置最大高度和最小高度
