今天 用 Request.Form /Request.Params 等怎么也获取不到客户发过来的Post 数据

后来试着用了 Request.InputStream 竟然可以

 

 
using (System.IO.StreamReader sr = new System.IO.StreamReader(Request.InputStream))
{
string inputStream = sr.ReadToEnd();
 

}

 

或者

 

byte[] byts = new byte[Request.InputStream.Length];
Request.InputStream.Read(byts, 0, byts.Length);
string req = System.Text.Encoding.Default.GetString(byts);
req = Server.UrlDecode(req);

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-28
  • 2022-12-23
  • 2021-06-11
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2021-12-11
  • 2022-12-23
相关资源
相似解决方案