在Asp.NET中读取HttpRequest Post标头 [英] Read HttpRequest Post header in Asp.NET
本文介绍了在Asp.NET中读取HttpRequest Post标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好专家,
我有一个链接的网站.点击链接后,它会创建下面的httpRequest并重定向到MyWebsites.点击链接后会写以下代码.
Hello expert,
I have a website which is having a link. On clicking the link it creates the below httpRequest and redirects to MyWebsites.Below code is written on click of the link.
Httprequest req = new Httprequest();
req.setEndpoint(''https://SERVWRIP/MyWebSite/'');
req.setMethod(''POST'');
req.setHeader(''latteOrgId'', loi);
req.setHeader(''open'', requestedDocument);
req.setHeader(''Content-Length'',’0’);
req.setTimeOut(200);
由于 MyWebSite 是在Asp.NET和C#中开发的,因此我需要在MyWebSite的default.aspx文件中读取http标头参数 latteOrgId , open .
Since MyWebSite is developed in Asp.NET and C# thus I need to read the http header parameter latteOrgId, open in default.aspx file of MyWebSite .
推荐答案
Request.Headers[YOUR_KEY_NAME]
将为您提供标头值.
示例:
Request.Headers[YOUR_KEY_NAME]
will give you the header values.
Example:
string latteOrgId = Request.Headers["latteOrgId"];
如果有帮助,请将其标记为答案
Mark it as answer if it is helpful
因此,我不确定您在哪里坚持下去.读取数据?
如果是这样,
Request.Forms["latteOrgId"]
将具有您要查找的数据.
So, I am not sure where are you stuck up with. Reading the data?
If so,
Request.Forms["latteOrgId"]
would have the data you are looking for.
您好
要在目标asp.net页上获取标头信息,请使用Request.Headers["latteOrgId"];
.
Hi
To get the header information at your target asp.net page useRequest.Headers["latteOrgId"];
.
这篇关于在Asp.NET中读取HttpRequest Post标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文