• 00
  • :
  • 00
  • :
  • 00

web api获得Post数据为空的解决办法

       using (var contentStream = Request.Content.ReadAsStreamAsync().Result)
            {
                contentStream.Seek(0, SeekOrigin.Begin);
                using (var sr = new StreamReader(contentStream))
                {
                    string str = sr.ReadToEnd();
                }
            }

https://www.itranslater.com/qa/details/2583767294652449792

posted @ 2021-01-06 22:51  Garson_Zhang  阅读(438)  评论(0编辑  收藏  举报