在ASP中 扩张HTTP HEADER后,并在ASPX中取得扩张值

2024-12-04 21:07:48
推荐回答(1个)
回答1:

ASP
--------------------------------------
On Error Resume Next
Set ObjXMLHttp = CreateObject("Msxml2.ServerXMLHTTP.3.0")

With ObjXMLHttp
.setRequestHeader "KEY", "123456789"
.setTimeouts 20000, 20000, 20000, 20000
.Open "GET", "h ttp://xxxx/test.aspx?prm=1", False
.Send
End With

If Err.Number = 0 And Not ObjXMLHttp Is Nothing Then
If CLng(ObjXMLHttp.Status) = 200 Then
Set SubXMLRequest = ObjXMLHttp.responseXML
End If
End If
---------------------------------
ASPX
-----------------------
protected void Page_Load(object sender, EventArgs e)
{
string key = Context.Request.Headers["KEY"];
}