如何在aspx页面中显示请求负载值

How to display request payload value in aspx page

我们的一个 angular2 应用程序正在将一些数据发布到 aspx 页面(使用 HTTPPOST)。我可以在开发人员工具(在浏览器中)的网络下看到发布的值。

我只是想将该值传递给另一个网络服务或显示在页面主体中。

这可能吗?

str = Request.InputStream;
// Find number of bytes in stream.
strLen = Convert.ToInt32(str.Length);
// Create a byte array.
byte[] strArr = new byte[strLen];
// Read stream into byte array.
strRead = str.Read(strArr, 0, strLen);

// Convert byte array to a text string.
strmContents = "";
for (counter = 0; counter < strLen; counter++)
{
    strmContents = strmContents + strArr[counter].ToString();            
}