简体   繁体   English

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

[英]How to display request payload value in aspx page

One of our angular2 application is posting some data to an aspx page (using HTTPPOST). 我们的angular2应用程序之一是将一些数据发布到aspx页面(使用HTTPPOST)。 I could see the posted values under Network in Developer Tools (in browser). 我可以在开发人员工具(在浏览器中)的“网络”下看到发布的值。

I just wanted to pass that value to another webservice or to display in the page body itself. 我只是想将该值传递给另一个Web服务或显示在页面主体中。

Is that possible? 那可能吗?

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();            
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM